Tweak includes/zhtable/Makefile.py
authorLiangent <liangent@gmail.com>
Sat, 12 May 2012 13:31:07 +0000 (21:31 +0800)
committerAntoine Musso <hashar@free.fr>
Thu, 17 May 2012 05:10:59 +0000 (07:10 +0200)
* Make it executable and use a more generic shebang line.
* Write ZhConversion.php to its own location directly, so it can be more
  convenient to do git checkout -b; edits; ./Makefile.py; git diff; to
  confirm changes made.
* Cosmetic text changes.

Change-Id: Ia3556e3b2cd5ee4eeaa67c4e535141576f13dc16

includes/zhtable/Makefile.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 305422b..2bb53ab
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 # @author Philip
 import tarfile as tf
@@ -39,7 +39,7 @@ LIBTABE_VER = '0.2.3'
 
 def download( url, dest ):
     if os.path.isfile( dest ):
-        print( 'File %s up to date.' % dest )
+        print( 'File %s is up to date.' % dest )
         return
     global islinux
     if islinux:
@@ -372,13 +372,13 @@ $zh2Hant = array(\n'''
         +  PHPArray( toSG ) \
         +  '\n);'
     
-    f = open( 'ZhConversion.php', 'wb', encoding = 'utf8' )
+    f = open( os.path.join( '..', 'ZhConversion.php' ), 'wb', encoding = 'utf8' )
     print ('Writing ZhConversion.php ... ')
     f.write( php )
     f.close()
     
-    #Remove temp files
-    print ('Deleting temp files ... ')
+    # Remove temporary files
+    print ('Deleting temporary files ... ')
     os.remove('EZ-Big.txt.in')
     os.remove('phrase_lib.txt')
     os.remove('tsi.src')