mailr15471 - /1.3/info.py


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

Header


Content

Posted by edward on March 12, 2012 - 15:26:
Author: bugman
Date: Mon Mar 12 15:26:57 2012
New Revision: 15471

URL: http://svn.gna.org/viewcvs/relax?rev=15471&view=rev
Log:
Added some code to detect the bit version of MS Windows in the information 
print out.

This should help better determine if 32 or 64-bit Windows is being used.


Modified:
    1.3/info.py

Modified: 1.3/info.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/info.py?rev=15471&r1=15470&r2=15471&view=diff
==============================================================================
--- 1.3/info.py (original)
+++ 1.3/info.py Mon Mar 12 15:26:57 2012
@@ -28,7 +28,7 @@
 if hasattr(ctypes, 'windll'):
     import ctypes.wintypes
 import numpy
-from os import popen3
+from os import environ, popen3
 import platform
 from string import split
 import sys
@@ -397,6 +397,8 @@
             text = text + (format % ("Distribution: ", (platform.dist()[0] + 
" " + platform.dist()[1] + " " + platform.dist()[2])))
         if hasattr(platform, 'platform'):
             text = text + (format % ("Full platform string: ", 
(platform.platform())))
+        if hasattr(ctypes, 'windll'):
+            text = text + (format % ("Windows architecture: ", 
(self.win_arch())))
 
         # Python info.
         text = text + ("\nPython information:\n")
@@ -436,6 +438,25 @@
         return text
 
 
+    def win_arch(self):
+        """Determine the MS Windows architecture.
+
+        @return:    The architecture string.
+        @rtype:     str
+        """
+
+        # 64-bit versions.
+        if environ.has_key('PROCESSOR_ARCHITEW6432'):
+            arch = environ['PROCESSOR_ARCHITEW6432']
+
+        # Default 32-bit.
+        else:
+            arch = environ['PROCESSOR_ARCHITECTURE']
+
+        # Return the architecture.
+        return arch
+
+
 
 class MemoryStatusEx(ctypes.Structure):
     """Special object for obtaining hardware info in MS Windows."""




Related Messages


Powered by MHonArc, Updated Mon Mar 12 18:20:01 2012