From bb5b81638d9a4c01b83b501593db8b437f0b3c4f Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Sat, 30 Apr 2011 08:18:30 +0800 Subject: Added test scripts to invoke python for i386 architecture, for local directory testing --- nxt-python-fantom/scripts/pyenv-nxt_test | 3 +++ nxt-python-fantom/scripts/pyenv-syspython | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 nxt-python-fantom/scripts/pyenv-nxt_test create mode 100755 nxt-python-fantom/scripts/pyenv-syspython diff --git a/nxt-python-fantom/scripts/pyenv-nxt_test b/nxt-python-fantom/scripts/pyenv-nxt_test new file mode 100755 index 0000000..32b097b --- /dev/null +++ b/nxt-python-fantom/scripts/pyenv-nxt_test @@ -0,0 +1,3 @@ +#!/bin/sh +export PYTHONPATH=/Users/tcmac/gitrepo/armdebug/nxt-python-fantom +arch -i386 /usr/bin/python2.6 /Users/tcmac/gitrepo/armdebug/nxt-python-fantom/scripts/nxt_test diff --git a/nxt-python-fantom/scripts/pyenv-syspython b/nxt-python-fantom/scripts/pyenv-syspython new file mode 100755 index 0000000..112e406 --- /dev/null +++ b/nxt-python-fantom/scripts/pyenv-syspython @@ -0,0 +1,3 @@ +#!/bin/sh +export PYTHONPATH=/Users/tcmac/gitrepo/armdebug/nxt-python-fantom +arch -i386 /usr/bin/python2.6 -- cgit v1.2.3 From d560125cbc778a02985b0615f50c177019191971 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Sat, 30 Apr 2011 08:22:21 +0800 Subject: Removed explicit user home directory from path --- nxt-python-fantom/scripts/pyenv-nxt_test | 4 ++-- nxt-python-fantom/scripts/pyenv-syspython | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nxt-python-fantom/scripts/pyenv-nxt_test b/nxt-python-fantom/scripts/pyenv-nxt_test index 32b097b..c78061c 100755 --- a/nxt-python-fantom/scripts/pyenv-nxt_test +++ b/nxt-python-fantom/scripts/pyenv-nxt_test @@ -1,3 +1,3 @@ #!/bin/sh -export PYTHONPATH=/Users/tcmac/gitrepo/armdebug/nxt-python-fantom -arch -i386 /usr/bin/python2.6 /Users/tcmac/gitrepo/armdebug/nxt-python-fantom/scripts/nxt_test +export PYTHONPATH=~/gitrepo/armdebug/nxt-python-fantom +arch -i386 /usr/bin/python2.6 ~/gitrepo/armdebug/nxt-python-fantom/scripts/nxt_test diff --git a/nxt-python-fantom/scripts/pyenv-syspython b/nxt-python-fantom/scripts/pyenv-syspython index 112e406..cea6c52 100755 --- a/nxt-python-fantom/scripts/pyenv-syspython +++ b/nxt-python-fantom/scripts/pyenv-syspython @@ -1,3 +1,3 @@ #!/bin/sh -export PYTHONPATH=/Users/tcmac/gitrepo/armdebug/nxt-python-fantom +export PYTHONPATH=~/gitrepo/armdebug/nxt-python-fantom arch -i386 /usr/bin/python2.6 -- cgit v1.2.3 From ab18bffaf964904081d435eb9344908536aea515 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Sat, 30 Apr 2011 08:23:07 +0800 Subject: fixed indentation error (?) --- nxt-python-fantom/nxt/sensor/hitechnic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxt-python-fantom/nxt/sensor/hitechnic.py b/nxt-python-fantom/nxt/sensor/hitechnic.py index d2bd8ec..3c152d3 100644 --- a/nxt-python-fantom/nxt/sensor/hitechnic.py +++ b/nxt-python-fantom/nxt/sensor/hitechnic.py @@ -247,7 +247,7 @@ class EOPD(BaseAnalogSensor): def __init__(self, brick, port): super(EOPD, self).__init__(brick, port) - from math import sqrt + from math import sqrt self.sqrt = sqrt def set_range_long(self): -- cgit v1.2.3 From 7159d0c9ea305ca1cb766ad783ae95f1b5f30d07 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Sat, 30 Apr 2011 08:23:54 +0800 Subject: fixed fantomglue import --- nxt-python-fantom/nxt/bluesock.py | 6 +++--- nxt-python-fantom/nxt/fantomglue.py | 8 ++++---- nxt-python-fantom/nxt/usbsock.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nxt-python-fantom/nxt/bluesock.py b/nxt-python-fantom/nxt/bluesock.py index b4a2739..99917f2 100644 --- a/nxt-python-fantom/nxt/bluesock.py +++ b/nxt-python-fantom/nxt/bluesock.py @@ -13,12 +13,12 @@ # GNU General Public License for more details. try: - import bluetooth + import fantomglue as bluetooth except ImportError: try: - import lightblueglue as bluetooth + import bluetooth except ImportError: - import pyfantom as bluetooth + import lightblueglue as bluetooth import os from .brick import Brick diff --git a/nxt-python-fantom/nxt/fantomglue.py b/nxt-python-fantom/nxt/fantomglue.py index 5e85e03..a4b6056 100644 --- a/nxt-python-fantom/nxt/fantomglue.py +++ b/nxt-python-fantom/nxt/fantomglue.py @@ -23,7 +23,7 @@ FANTOM_USB = 0 # Bluetooth Iterator def discover_devices(lookup_names=False): # parameter is ignored pairs = [] - for d in NXTIterator(True): + for d in pyfantom.NXTIterator(True): # h: host, n: name h = d.get_resource_string() nxt = d.get_nxt() @@ -44,7 +44,7 @@ class BluetoothSocket: addr, port = addrport if self._sock is None: # Port is ignored - self._sock = NXT(addr) + self._sock = pyfantom.NXT(addr) def send(self, data): return self._sock.write( data ) @@ -64,7 +64,7 @@ def _check_brick(arg, value): def find_devices(lookup_names=False): # parameter is ignored devicelist = [] - for d in NXTIterator(False): + for d in pyfantom.NXTIterator(False): nxt = d.get_nxt() devicelist.append(nxt) return devicelist @@ -99,7 +99,7 @@ class USBSocket: addr, port = addrport if self._sock is None: # Port is ignored - self._sock = NXT(addr) + self._sock = pyfantom.NXT(addr) def send(self, data): return self._sock.write( data ) diff --git a/nxt-python-fantom/nxt/usbsock.py b/nxt-python-fantom/nxt/usbsock.py index 78c21ab..0375869 100644 --- a/nxt-python-fantom/nxt/usbsock.py +++ b/nxt-python-fantom/nxt/usbsock.py @@ -13,9 +13,9 @@ # GNU General Public License for more details. try: - import pyusbglue as usb + import fantomglue as usb except ImportError: - import pyfantom as usb + import pyusbglue as usb from nxt.brick import Brick -- cgit v1.2.3 From 1e3b294f345511538c64cce8f9f3e0ba3c82d1e3 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Tue, 3 May 2011 14:46:37 +0800 Subject: fixed minor cut and past errors --- nxt-python-fantom/nxt/fantomglue.py | 1 - nxt-python-fantom/nxt/usbsock.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/nxt-python-fantom/nxt/fantomglue.py b/nxt-python-fantom/nxt/fantomglue.py index a4b6056..6281c95 100644 --- a/nxt-python-fantom/nxt/fantomglue.py +++ b/nxt-python-fantom/nxt/fantomglue.py @@ -96,7 +96,6 @@ class USBSocket: return devinfo.name def connect(self): - addr, port = addrport if self._sock is None: # Port is ignored self._sock = pyfantom.NXT(addr) diff --git a/nxt-python-fantom/nxt/usbsock.py b/nxt-python-fantom/nxt/usbsock.py index 0375869..9df7792 100644 --- a/nxt-python-fantom/nxt/usbsock.py +++ b/nxt-python-fantom/nxt/usbsock.py @@ -25,7 +25,7 @@ class USBSock(object): bsize = 60 # USB socket block size def __init__(self, device): - self.sock = USBSocket(device) + self.sock = usb.USBSocket(device) self.debug = False def __str__(self): -- cgit v1.2.3