[pypy-svn] r28720 - in pypy/dist/pypy: bin rpython/rctypes/tool

arigo at codespeak.net arigo at codespeak.net
Mon Jun 12 18:51:46 CEST 2006


Author: arigo
Date: Mon Jun 12 18:51:46 2006
New Revision: 28720

Added:
   pypy/dist/pypy/bin/compilemodule.py   (contents, props changed)
Modified:
   pypy/dist/pypy/rpython/rctypes/tool/compilemodule.py
Log:
Added pypy/bin/compilemodule.py, currently just a facade for the real
compilemodule.py in rctypes/tool/.



Added: pypy/dist/pypy/bin/compilemodule.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/bin/compilemodule.py	Mon Jun 12 18:51:46 2006
@@ -0,0 +1,12 @@
+#! /usr/bin/env python
+"""
+Usage:  compilemodule.py <module-name>
+
+Compiles the PyPy extension module from  pypy/module/<module-name>/
+into a regular CPython extension module.
+"""
+
+import autopath, sys
+from pypy.rpython.rctypes.tool.compilemodule import main
+
+main(sys.argv)

Modified: pypy/dist/pypy/rpython/rctypes/tool/compilemodule.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/tool/compilemodule.py	(original)
+++ pypy/dist/pypy/rpython/rctypes/tool/compilemodule.py	Mon Jun 12 18:51:46 2006
@@ -61,9 +61,12 @@
     driver.proceed(['compile_c'])
     return driver.cbuilder.c_ext_module
 
-
-if __name__ == '__main__':
-    if len(sys.argv) != 2:
+def main(argv):
+    if len(argv) != 2:
         print >> sys.stderr, __doc__
         sys.exit(2)
-    compilemodule(sys.argv[1])
+    compilemodule(argv[1])
+
+
+if __name__ == '__main__':
+    main(sys.argv)



More information about the Pypy-commit mailing list