Better locating of SmartRF Studio 7.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 24 Apr 2011 17:01:20 +0000 (17:01 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 24 Apr 2011 17:01:20 +0000 (17:01 +0000)
A warning is printed if the 64-bit NT build of Python is used.

git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1010 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFET.py
client/GoodFETCC.py

index 0d32cca..de3ce7d 100755 (executable)
@@ -76,6 +76,9 @@ class GoodFET:
         """Open the serial port"""
         # Make timeout None to wait forever, 0 for non-blocking mode.
         
+        if os.name=='nt' and sys.version.find('64 bit')!=-1:
+            print "WARNING: PySerial requires a 32-bit Python build in Windows.";
+        
         if port is None and os.environ.get("GOODFET")!=None:
             glob_list = glob.glob(os.environ.get("GOODFET"));
             if len(glob_list) > 0:
index 165aa73..2427e03 100644 (file)
@@ -24,9 +24,8 @@ class GoodFETCC(GoodFET):
         if self.smartrfpath==None:
             self.smartrfpath=os.environ.get("SMARTRF");
         if self.smartrfpath==None and os.name=='nt':
-            self.smartrfpath="c:/Program Files (x86)/Texas Instruments/SmartRF Tools/SmartRF Studio 7";
-            if not os.path.exists(self.smartrfpath):
-                self.smartrfpath="c:/Program Files/Texas Instruments/SmartRF Tools/SmartRF Studio 7";
+            pf=os.environ['PROGRAMFILES'];
+            self.smartrfpath="%s\\\\Texas Instruments\\\\SmartRF Tools\\\\SmartRF Studio 7" % pf;
             
         if self.smartrfpath==None:
             self.smartrfpath="/opt/smartrf7";