[Numpy-svn] r5544 - trunk/tools/win32build

numpy-svn@scip... numpy-svn@scip...
Sun Jul 27 21:05:07 CDT 2008


Author: cdavid
Date: 2008-07-27 21:05:03 -0500 (Sun, 27 Jul 2008)
New Revision: 5544

Modified:
   trunk/tools/win32build/build.py
Log:
Use OptionParser for win32 build script.

Modified: trunk/tools/win32build/build.py
===================================================================
--- trunk/tools/win32build/build.py	2008-07-26 07:56:58 UTC (rev 5543)
+++ trunk/tools/win32build/build.py	2008-07-28 02:05:03 UTC (rev 5544)
@@ -10,6 +10,7 @@
 import subprocess
 import os
 import shutil
+from os.path import join as pjoin, split as psplit, dirname
 
 PYEXECS = {"2.5" : "C:\python25\python.exe",
         "2.4" : "C:\python24\python2.4.exe"}
@@ -94,17 +95,22 @@
     name = "numpy-%s.win32-py%s.exe" % (get_numpy_version(), pyver)
     return name
 
-USAGE = """build.py ARCH PYTHON_VERSION
+if __name__ == '__main__':
+    from optparse import OptionParser
+    parser = OptionParser()
+    parser.add_option("-a", "--arch", dest="arch", 
+                      help = "Architecture to build (sse2, sse3, nosse, etc...)")
+    parser.add_option("-p", "--pyver", dest="pyver",
+                      help = "Python version (2.4, 2.5, etc...)")
 
-Example: build.py sse2 2.4."""
+    opts, args = parser.parse_args()
+    arch = opts.arch
+    pyver = opts.pyver
 
-if __name__ == '__main__':
-    if len(sys.argv) < 3:
-        raise ValueError(USAGE)
-        sys.exit(-1)
-
-    arch = sys.argv[1]
-    pyver = sys.argv[2]
-    #build(arch, pyver)
-    for arch in SITECFG.keys():
-        build(arch, pyver)
+    if not arch:
+        arch = "nosse"
+    if not pyver:
+        pyver = "2.5"
+    build(arch, pyver)
+    #for arch in SITECFG.keys():
+    #    build(arch, pyver)



More information about the Numpy-svn mailing list