Remove superfluous trailing white space from Python files

This commit is contained in:
Douglas Clowes
2014-05-16 13:01:13 +10:00
parent 4c65f82116
commit 89e4e37f9e
16 changed files with 60 additions and 60 deletions

View File

@@ -185,14 +185,14 @@ class Lakeshore336(LakeshoreDevice):
def doQueryALARM(self, cmd, args):
if len(args) > 0:
idx = ord(args[0]) - 64
if idx in self.ALARM:
if idx in self.ALARM:
self.write(self.ALARM[idx])
else:
self.write("0,1,500.0,0.0,0")
def doQueryALARMST(self, cmd, args):
if len(args) > 0:
idx = ord(args[0]) - 64
if idx in self.ALARMST:
if idx in self.ALARMST:
self.write(self.ALARMST[idx])
else:
self.write("0,0")
@@ -273,7 +273,7 @@ class Lakeshore336(LakeshoreDevice):
self.write("%f" % self.COMM)
def doQueryCRDG(self, cmd, args):
idx = ord(args[0]) - 64
if idx in self.KRDG:
if idx in self.KRDG:
if self.RANDOM > 0:
self.write("%f" % (self.KRDG[idx] - 273.15 + random.uniform(-self.RANDOM, self.RANDOM)))
else:
@@ -339,8 +339,8 @@ class Lakeshore336(LakeshoreDevice):
for key in keys:
self.FILTER[key] = params
def doQueryFILTER(self, cmd, args):
idx = int(args[0])
if idx in self.FILTER:
idx = int(args[0])
if idx in self.FILTER:
self.write(self.FILTER[idx])
else:
raise IndexError
@@ -358,7 +358,7 @@ class Lakeshore336(LakeshoreDevice):
self.IEEE = args[0]
def doQueryINCRV(self, cmd, args):
idx = ord(args[0]) - 64
if idx in self.INCRV:
if idx in self.INCRV:
self.write(self.INCRV[idx])
else:
self.write("0")
@@ -370,7 +370,7 @@ class Lakeshore336(LakeshoreDevice):
self.INCRV[key] = args[1]
def doQueryINTYPE(self, cmd, args):
idx = ord(args[0]) - 64
if idx in self.INTYPE:
if idx in self.INTYPE:
self.write(self.INTYPE[idx])
else:
self.write("0")
@@ -385,7 +385,7 @@ class Lakeshore336(LakeshoreDevice):
self.KEYST = 0
def doQueryKRDG(self, cmd, args):
idx = ord(args[0]) - 64
if idx in self.KRDG:
if idx in self.KRDG:
if self.RANDOM > 0:
self.write("%f" % (self.KRDG[idx] + random.uniform(-self.RANDOM, self.RANDOM)))
else:
@@ -504,7 +504,7 @@ class Lakeshore336(LakeshoreDevice):
self.write("%f" % val)
def doCommandSETP(self, cmd, args):
idx = int(args[0])
val = float(args[1])
val = float(args[1])
if (val >= 0.0 and val <= 500.0):
self.TARGET[idx] = val
if self.RAMP_ON[idx] == 0:

View File

@@ -185,14 +185,14 @@ class Lakeshore340(LakeshoreDevice):
def doQueryALARM(self, cmd, args):
if len(args) > 0:
idx = ord(args[0]) - 64
if idx in self.ALARM:
if idx in self.ALARM:
self.write(self.ALARM[idx])
else:
self.write("0,1,500.0,0.0,0")
def doQueryALARMST(self, cmd, args):
if len(args) > 0:
idx = ord(args[0]) - 64
if idx in self.ALARMST:
if idx in self.ALARMST:
self.write(self.ALARMST[idx])
else:
self.write("0,0")
@@ -273,7 +273,7 @@ class Lakeshore340(LakeshoreDevice):
self.write("%f" % self.COMM)
def doQueryCRDG(self, cmd, args):
idx = ord(args[0]) - 64
if idx in self.KRDG:
if idx in self.KRDG:
if self.RANDOM > 0:
self.write("%f" % (self.KRDG[idx] - 273.15 + random.uniform(-self.RANDOM, self.RANDOM)))
else:
@@ -354,8 +354,8 @@ class Lakeshore340(LakeshoreDevice):
for key in keys:
self.FILTER[key] = params
def doQueryFILTER(self, cmd, args):
idx = int(args[0])
if idx in self.FILTER:
idx = int(args[0])
if idx in self.FILTER:
self.write(self.FILTER[idx])
else:
raise IndexError
@@ -373,7 +373,7 @@ class Lakeshore340(LakeshoreDevice):
self.IEEE = args[0]
def doQueryINCRV(self, cmd, args):
idx = ord(args[0]) - 64
if idx in self.INCRV:
if idx in self.INCRV:
self.write(self.INCRV[idx])
else:
self.write("0")
@@ -385,19 +385,19 @@ class Lakeshore340(LakeshoreDevice):
self.INCRV[key] = args[1]
def doQueryINTYPE(self, cmd, args):
idx = ord(args[0]) - 64
if idx in self.INTYPE:
if idx in self.INTYPE:
self.write(self.INTYPE[idx])
else:
self.write("0")
def doQueryINSET(self, cmd, args):
idx = ord(args[0])
if idx in self.INSET:
idx = ord(args[0])
if idx in self.INSET:
self.write(self.INSET[idx])
else:
self.write("0,0")
def doCommandINSET(self, cmd, args):
if len(args) > 0:
idx = ord(args[0])
idx = ord(args[0])
if idx in self.INSET:
self.INSET[idx] = ",".join(args[1:])
def doCommandINTYPE(self, cmd, args):
@@ -411,7 +411,7 @@ class Lakeshore340(LakeshoreDevice):
self.KEYST = 0
def doQueryKRDG(self, cmd, args):
idx = ord(args[0]) - 64
if idx in self.KRDG:
if idx in self.KRDG:
if self.RANDOM > 0:
self.write("%f" % (self.KRDG[idx] + random.uniform(-self.RANDOM, self.RANDOM)))
else:
@@ -517,7 +517,7 @@ class Lakeshore340(LakeshoreDevice):
self.write("%f" % val)
def doCommandSETP(self, cmd, args):
idx = int(args[0])
val = float(args[1])
val = float(args[1])
if (val >= 0.0 and val <= 500.0):
self.TARGET[idx] = val
if self.RAMP_ON[idx] == 0:

View File

@@ -177,14 +177,14 @@ class Lakeshore370(LakeshoreDevice):
for key in keys:
self.ALARM[key] = params
def doQueryALARM(self, cmd, args):
idx = int(args[0])
if idx in self.ALARM:
idx = int(args[0])
if idx in self.ALARM:
self.write(self.ALARM[idx])
else:
self.write("0,1,500.0,0.0,0")
def doQueryALARMST(self, cmd, args):
idx = int(args[0])
if idx in self.ALARMST:
if idx in self.ALARMST:
self.write(self.ALARMST[idx])
else:
self.write("0,0")
@@ -309,8 +309,8 @@ class Lakeshore370(LakeshoreDevice):
for key in keys:
self.FILTER[key] = params
def doQueryFILTER(self, cmd, args):
idx = int(args[0])
if idx in self.FILTER:
idx = int(args[0])
if idx in self.FILTER:
self.write(self.FILTER[idx])
else:
raise IndexError
@@ -339,8 +339,8 @@ class Lakeshore370(LakeshoreDevice):
def doCommandIEEE(self, cmd, args):
self.IEEE = args[0]
def doQueryINSET(self, cmd, args):
idx = int(args[0])
if idx in self.INSET:
idx = int(args[0])
if idx in self.INSET:
self.write(self.INSET[idx])
else:
self.write("0")
@@ -414,8 +414,8 @@ class Lakeshore370(LakeshoreDevice):
response = "%d" % self.RAMP_ST
self.write(response)
def doQueryRDGK(self, cmd, args):
idx = int(args[0])
if idx in self.KRDG:
idx = int(args[0])
if idx in self.KRDG:
if self.RANDOM > 0:
self.write("%f" % (self.KRDG[idx] + random.uniform(-self.RANDOM, self.RANDOM)))
else:
@@ -452,7 +452,7 @@ class Lakeshore370(LakeshoreDevice):
self.write("%f" % val)
def doCommandSETP(self, cmd, args):
idx = 1
val = float(args[0])
val = float(args[0])
if (val >= 0.0 and val <= 500.0):
self.TARGET[idx] = val
if self.RAMP_ON[idx] == 0:

View File

@@ -21,7 +21,7 @@ class LakeshoreProtocol(Protocol):
print "connectionMade:", self.factory.numProtocols
if self.factory.numProtocols > 2:
print "Too many connections - rejecting"
self.transport.write("Too many connections, try later" + self.term)
self.transport.write("Too many connections, try later" + self.term)
self.transport.loseConnection()
else:
self.transport.write(("Welcome connection %d" % self.factory.numProtocols) + self.term)
@@ -55,7 +55,7 @@ class LakeshoreProtocol(Protocol):
self.response = ""
else:
self.pdu = self.pdu + c
if __name__ == '__main__':
class TestDevice:
def __init__(self):

View File

@@ -25,7 +25,7 @@ class MercuryProtocol(Protocol):
print "connectionMade:", self.factory.numProtocols
if self.factory.numProtocols > 2:
print "Too many connections - rejecting"
self.transport.write("Too many connections, try later" + self.term)
self.transport.write("Too many connections, try later" + self.term)
self.transport.loseConnection()
else:
self.transport.write(("Welcome connection %d" % self.factory.numProtocols) + self.term)
@@ -59,7 +59,7 @@ class MercuryProtocol(Protocol):
self.response = ""
else:
self.pdu = self.pdu + c
if __name__ == '__main__':
class TestDevice:
def __init__(self):