Commit f23b9ca7 authored by auke.klazema's avatar auke.klazema
Browse files

Fixed pep8 lines issues and unneeded \

parent 92da2f8a
...@@ -3,10 +3,9 @@ import time ...@@ -3,10 +3,9 @@ import time
import re import re
import platform import platform
class PROLOGIX_GPIB_USB(): class PROLOGIX_GPIB_USB():
def __init__(self, \ def __init__(self, port="", timeout=1, portFormat="%d", maxDeviceNum=9, verbose=False,
port="", timeout=1, \
portFormat="%d", maxDeviceNum=9, verbose=False, \
findDevices=False): findDevices=False):
if port == "": if port == "":
if platform.system() == "Linux": if platform.system() == "Linux":
...@@ -85,15 +84,12 @@ class PROLOGIX_GPIB_USB(): ...@@ -85,15 +84,12 @@ class PROLOGIX_GPIB_USB():
def getDevices(self): def getDevices(self):
return self._devices return self._devices
class GPIB_232_485CT_A(): class GPIB_232_485CT_A():
def __init__(self, \ def __init__(self, port="/dev/ttyS0", baudrate=9600, bytesize=serial.EIGHTBITS,
port="/dev/ttyS0", \ parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, interCharTimeout=None,
baudrate=9600, bytesize=serial.EIGHTBITS, \ pause=0, timeout=10):
parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, \ self._serialPort = serial.Serial(port, baudrate, bytesize, parity, stopbits,
interCharTimeout=None, pause=0, timeout=10):
self._serialPort = serial.Serial(port, \
baudrate, bytesize, \
parity, stopbits, \
interCharTimeout, timeout) interCharTimeout, timeout)
self._serialPort.flushInput() self._serialPort.flushInput()
self._pause = pause self._pause = pause
...@@ -114,6 +110,7 @@ class GPIB_232_485CT_A(): ...@@ -114,6 +110,7 @@ class GPIB_232_485CT_A():
self._commandStr = "loc "+str(hpib_address)+chr(13) self._commandStr = "loc "+str(hpib_address)+chr(13)
self._commandCount = self._serialPort.write(self._commandStr) self._commandCount = self._serialPort.write(self._commandStr)
class hpib_device(): class hpib_device():
def __init__(self, hpib_address, port, keepLocal=False,pause=0): def __init__(self, hpib_address, port, keepLocal=False,pause=0):
self._hpib_address = hpib_address self._hpib_address = hpib_address
......
...@@ -98,5 +98,6 @@ class PrologixGpibUsbTest(unittest.TestCase): ...@@ -98,5 +98,6 @@ class PrologixGpibUsbTest(unittest.TestCase):
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
hpib.PROLOGIX_GPIB_USB(port="device") hpib.PROLOGIX_GPIB_USB(port="device")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment