Moved 'import serial' into the serInit() function.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 28 Aug 2011 19:53:46 +0000 (19:53 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 28 Aug 2011 19:53:46 +0000 (19:53 +0000)
About to wrap for py-bluez support.

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

client/GoodFET.py

index ce83100..89362df 100755 (executable)
@@ -5,7 +5,7 @@
 #
 # This code is being rewritten and refactored.  You've been warned!
 
 #
 # This code is being rewritten and refactored.  You've been warned!
 
-import sys, time, string, cStringIO, struct, glob, serial, os;
+import sys, time, string, cStringIO, struct, glob, os;
 import sqlite3;
 
 fmt = ("B", "<H", None, "<L")
 import sqlite3;
 
 fmt = ("B", "<H", None, "<L")
@@ -75,6 +75,7 @@ class GoodFET:
     def serInit(self, port=None, timeout=2, attemptlimit=None):
         """Open the serial port"""
         # Make timeout None to wait forever, 0 for non-blocking mode.
     def serInit(self, port=None, timeout=2, attemptlimit=None):
         """Open the serial port"""
         # Make timeout None to wait forever, 0 for non-blocking mode.
+        import serial;
         
         if os.name=='nt' and sys.version.find('64 bit')!=-1:
             print "WARNING: PySerial requires a 32-bit Python build in Windows.";
         
         if os.name=='nt' and sys.version.find('64 bit')!=-1:
             print "WARNING: PySerial requires a 32-bit Python build in Windows.";