Commits

Anonymous committed dd4de7a

Add a script that can be used to run this from the commandline.

  • Participants
  • Parent commits f4d82a7

Comments (0)

Files changed (3)

 [releaser]
 recipe = z3c.recipe.scripts
 eggs = zest.releaser
+       jslex
 
 [devpython]
 recipe = z3c.recipe.scripts:interpreter
+import os, sys
+from jslex import js_to_c_for_gettext
+
+def jslex_prepare():
+    try:
+        filename = sys.argv[1]
+    except IndexError:
+        print "Usage: jslex_prepare <filename>"
+        sys.exit(1)
+    f = open(filename, 'r')
+    src = f.read()
+    f.close()
+    src = js_to_c_for_gettext(src)
+    filename, ext = os.path.splitext(filename)
+    filename += '.jslex'
+    f = open(filename, 'w')
+    f.write(src)
+    f.close()
+    
     long_description=long_description,
     license='BSD',
     url='https://bitbucket.org/ned/jslex',
-    py_modules=['jslex'],
+    py_modules=['jslex', 'jslex_scripts'],
     zip_safe=False,
+    entry_points={
+        'console_scripts': [
+            'jslex_prepare = jslex_scripts:jslex_prepare'
+            ]
+        }
     )