mailr22156 - /trunk/devel_scripts/python_seek.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on February 07, 2014 - 17:46:
Author: bugman
Date: Fri Feb  7 17:46:05 2014
New Revision: 22156

URL: http://svn.gna.org/viewcvs/relax?rev=22156&view=rev
Log:
The python_seek.py development script now allows the modules to be specified 
on the command line.

This speeds up the script and allows individual modules to be checked and the 
version displayed.


Modified:
    trunk/devel_scripts/python_seek.py

Modified: trunk/devel_scripts/python_seek.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/devel_scripts/python_seek.py?rev=22156&r1=22155&r2=22156&view=diff
==============================================================================
--- trunk/devel_scripts/python_seek.py (original)
+++ trunk/devel_scripts/python_seek.py Fri Feb  7 17:46:05 2014
@@ -10,6 +10,17 @@
 from subprocess import PIPE, Popen
 import sys
 
+# The default module list.
+MOD_LIST = [
+    'minfx',
+    'bmrblib',
+    'numpy',
+    'scipy',
+    'wx',
+    'mpi4py',
+    'epydoc'
+]
+
 
 class Python_info:
     """Find all Python versions and the supported modules."""
@@ -23,6 +34,9 @@
 
         # Get a list of all Python binaries.
         files = self.get_files()
+
+        # The modules to find.
+        self.modules()
 
         # Loop over the binaries.
         for file in files:
@@ -30,14 +44,22 @@
             print("Testing %s:" % file)
 
             # Determine and print out the version info.
-            self.version_python(file)
-            self.version_minfx(file)
-            self.version_bmrblib(file)
-            self.version_numpy(file)
-            self.version_scipy(file)
-            self.version_wx(file)
-            self.version_mpi4py(file)
-            self.version_epydoc(file)
+            if 'python' in self.module_list:
+                self.version_python(file)
+            if 'minfx' in self.module_list:
+                self.version_minfx(file)
+            if 'bmrblib' in self.module_list:
+                self.version_bmrblib(file)
+            if 'numpy' in self.module_list:
+                self.version_numpy(file)
+            if 'scipy' in self.module_list:
+                self.version_scipy(file)
+            if 'wx' in self.module_list:
+                self.version_wx(file)
+            if 'mpi4py' in self.module_list:
+                self.version_mpi4py(file)
+            if 'epydoc' in self.module_list:
+                self.version_epydoc(file)
 
 
     def execute(self, label=None, file=None, commands=None):
@@ -127,6 +149,24 @@
 
         # Return the file list.
         return binaries
+
+
+    def modules(self):
+        """Determine the modules to find."""
+
+        # Arguments supplied, so use these.
+        if len(sys.argv) > 1:
+            # Initialise the list.
+            self.module_list = []
+
+            # Loop over the arguments.
+            for i in range(1, len(sys.argv)):
+                if sys.argv[i] in MOD_LIST:
+                    self.module_list.append(sys.argv[i])
+
+        # Use the defaults.
+        else:
+            self.module_list = MOD_LIST
 
 
     def version_bmrblib(self, file=None):




Related Messages


Powered by MHonArc, Updated Fri Feb 07 18:00:02 2014