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

Fixed pep8 lines issues and unneeded \

parent 92da2f8a
......@@ -2,14 +2,13 @@ import serial
import time
import re
import platform
class PROLOGIX_GPIB_USB():
def __init__(self, \
port="", timeout=1, \
portFormat="%d", maxDeviceNum=9, verbose=False, \
def __init__(self, port="", timeout=1, portFormat="%d", maxDeviceNum=9, verbose=False,
findDevices=False):
if port == "":
if platform.system() == "Linux":
if platform.system() == "Linux":
port = "/dev/ttyUSB0"
portFormat = "%d"
maxDeviceNum = 99
......@@ -84,16 +83,13 @@ class PROLOGIX_GPIB_USB():
return
def getDevices(self):
return self._devices
class GPIB_232_485CT_A():
def __init__(self, \
port="/dev/ttyS0", \
baudrate=9600, bytesize=serial.EIGHTBITS, \
parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, \
interCharTimeout=None, pause=0, timeout=10):
self._serialPort = serial.Serial(port, \
baudrate, bytesize, \
parity, stopbits, \
def __init__(self, port="/dev/ttyS0", baudrate=9600, bytesize=serial.EIGHTBITS,
parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, interCharTimeout=None,
pause=0, timeout=10):
self._serialPort = serial.Serial(port, baudrate, bytesize, parity, stopbits,
interCharTimeout, timeout)
self._serialPort.flushInput()
self._pause = pause
......@@ -113,7 +109,8 @@ class GPIB_232_485CT_A():
def setLocal(self, hpib_address):
self._commandStr = "loc "+str(hpib_address)+chr(13)
self._commandCount = self._serialPort.write(self._commandStr)
class hpib_device():
def __init__(self, hpib_address, port, keepLocal=False,pause=0):
self._hpib_address = hpib_address
......
......@@ -98,5 +98,6 @@ class PrologixGpibUsbTest(unittest.TestCase):
with self.assertRaises(ValueError):
hpib.PROLOGIX_GPIB_USB(port="device")
if __name__ == '__main__':
unittest.main()
Markdown is supported
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