Skip to content

Commit

Permalink
Remove unnecessary timeout arg
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Nov 16, 2015
1 parent 99e82c1 commit 51ba01b
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 31 deletions.
2 changes: 0 additions & 2 deletions docs/comms/pva.rst
Expand Up @@ -54,5 +54,3 @@ or on different machines, and it should make no difference.
The high level objects I would expect to be written in Python, while the lower level
objects should be written in C++ (although they are currently in Python talking CA to
V3 IOCs).


4 changes: 1 addition & 3 deletions malcolm/core/device.py
Expand Up @@ -63,10 +63,8 @@ class Device(HasAttributes, HasMethods, HasStateMachine, HasLoops):
",")
not_process_creatable = []

def __init__(self, name, timeout=None):
def __init__(self, name):
super(Device, self).__init__(name)
# TODO: delete this?
self.timeout = timeout
self.add_stateMachine_transitions()
self.add_all_attributes()
self.add_methods()
Expand Down
3 changes: 1 addition & 2 deletions malcolm/core/deviceclient.py
Expand Up @@ -45,10 +45,9 @@ class DeviceClient(HasAttributes, HasMethods, HasStateMachine, HasLoops):
_endpoints = "name,descriptor,tags,methods,stateMachine,attributes".split(
",")

def __init__(self, name, sock, monitor=True, timeout=None):
def __init__(self, name, sock, monitor=True):
super(DeviceClient, self).__init__(name + "Client")
self.devicename = name
self.timeout = timeout
self.monitor = monitor
self.sock = sock
self.add_methods()
Expand Down
5 changes: 2 additions & 3 deletions malcolm/core/directoryservice.py
Expand Up @@ -12,9 +12,8 @@
@not_process_creatable
class DirectoryService(Process):

def __init__(self, server_strings, name="DirectoryService", timeout=None):
super(DirectoryService, self).__init__(server_strings, name,
timeout=timeout)
def __init__(self, server_strings, name="DirectoryService"):
super(DirectoryService, self).__init__(server_strings, name)
# Connection strings dict
self._connection_strings = {}
# registered devices deviceClient instances
Expand Down
4 changes: 2 additions & 2 deletions malcolm/core/process.py
Expand Up @@ -19,11 +19,11 @@
class Process(Device, multiprocessing.Process):

def __init__(self, serverStrings, name, ds_name="DirectoryService",
ds_string=None, timeout=None):
ds_string=None):
"""name is process name
serverStrings is list of "zmq://tcp://172.23.122.23:5600"
"""
super(Process, self).__init__(name, timeout)
super(Process, self).__init__(name)
# Store ds details
self.ds = None
self.ds_name = ds_name
Expand Down
4 changes: 2 additions & 2 deletions malcolm/core/subscription.py
Expand Up @@ -38,9 +38,9 @@ def loop_stop(self, *args, **kwargs):

class ClientSubscription(EventLoop):

def __init__(self, sock, endpoint, callback, timeout=None):
def __init__(self, sock, endpoint, callback):
name = "ClientSubscription.{}".format(endpoint)
super(ClientSubscription, self).__init__(name, timeout)
super(ClientSubscription, self).__init__(name)
self.add_event_handler(SType.Value, callback)
# TODO: add errback
# el.add_event_handler(SType.Error, callback)
Expand Down
4 changes: 2 additions & 2 deletions malcolm/devices/dummydet.py
Expand Up @@ -77,9 +77,9 @@ class DummyDet(PausableDevice):
class_attributes = dict(
single=Attribute(VBool, "Whether to single step or not"))

def __init__(self, name, single=False, timeout=None):
def __init__(self, name, single=False):
# TODO: add single step
super(DummyDet, self).__init__(name, timeout=timeout)
super(DummyDet, self).__init__(name)
self.single = single
self.sim = DummyDetSim(name + "Sim")
self.sim.add_listener(self.post_changes)
Expand Down
4 changes: 2 additions & 2 deletions malcolm/devices/hdf5writer.py
Expand Up @@ -12,10 +12,10 @@ class Hdf5Writer(HasConfigSequence, RunnableDevice):
readbacks=Attribute(VBool, "Whether this detector produces position "
"readbacks rather than data"))

def __init__(self, name, prefix, readbacks=False, timeout=None):
def __init__(self, name, prefix, readbacks=False):
self.prefix = prefix
self.readbacks = readbacks
super(Hdf5Writer, self).__init__(name, timeout)
super(Hdf5Writer, self).__init__(name)

def add_all_attributes(self):
super(Hdf5Writer, self).add_all_attributes()
Expand Down
4 changes: 2 additions & 2 deletions malcolm/devices/positionplugin.py
Expand Up @@ -9,9 +9,9 @@ class PositionPlugin(HasConfigSequence, RunnableDevice):
class_attributes = dict(
prefix=Attribute(VString, "PV Prefix for device"))

def __init__(self, name, prefix, timeout=None):
def __init__(self, name, prefix):
self.prefix = prefix
super(PositionPlugin, self).__init__(name, timeout)
super(PositionPlugin, self).__init__(name)

def add_all_attributes(self):
super(PositionPlugin, self).add_all_attributes()
Expand Down
4 changes: 2 additions & 2 deletions malcolm/devices/progscan.py
Expand Up @@ -7,9 +7,9 @@ class ProgScan(HasConfigSequence, RunnableDevice):
class_attributes = dict(
prefix=Attribute(VString, "PV Prefix for device"))

def __init__(self, name, prefix, timeout=None):
def __init__(self, name, prefix):
self.prefix = prefix
super(ProgScan, self).__init__(name, timeout)
super(ProgScan, self).__init__(name)

def add_all_attributes(self):
super(ProgScan, self).add_all_attributes()
Expand Down
4 changes: 2 additions & 2 deletions malcolm/devices/simdetector.py
Expand Up @@ -7,9 +7,9 @@ class SimDetector(HasConfigSequence, RunnableDevice):
class_attributes = dict(
prefix=Attribute(VString, "PV Prefix for device"))

def __init__(self, name, prefix, timeout=None):
def __init__(self, name, prefix):
self.prefix = prefix
super(SimDetector, self).__init__(name, timeout)
super(SimDetector, self).__init__(name)

def add_all_attributes(self):
super(SimDetector, self).add_all_attributes()
Expand Down
5 changes: 2 additions & 3 deletions malcolm/personalities/simdetectorpersonality.py
Expand Up @@ -21,9 +21,8 @@ class SimDetectorPersonality(PausableDevice):
PositionPlugin, "PositionPlugin Device"),
)

def __init__(self, name, simDetector, positionPlugin, hdf5Writer,
timeout=None):
super(SimDetectorPersonality, self).__init__(name, timeout)
def __init__(self, name, simDetector, positionPlugin, hdf5Writer):
super(SimDetectorPersonality, self).__init__(name)
self.simDetector = simDetector
self.positionPlugin = positionPlugin
self.hdf5Writer = hdf5Writer
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core/test_device.py
Expand Up @@ -21,7 +21,7 @@
class DeviceTest(unittest.TestCase):

def setUp(self):
self.d = DummyDet("D", timeout=1)
self.d = DummyDet("D")
self.d.loop_run()
self.reset_cb_lists()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_core/test_deviceclient.py
Expand Up @@ -25,7 +25,7 @@ class DeviceTest(unittest.TestCase):

def setUp(self):
self.sock = MagicMock()
self.d = DeviceClient("D", self.sock, timeout=1)
self.d = DeviceClient("D", self.sock)
self.assertEqual(self.sock.mock_calls, [])

def test_run_calls_right_things(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_zmqtransport/test_zmq_system.py
Expand Up @@ -24,8 +24,8 @@

class Counter(Device):

def __init__(self, name, timeout=None):
super(Counter, self).__init__(name, timeout)
def __init__(self, name):
super(Counter, self).__init__(name)
self.counter = 0
self.add_loop(TimerLoop("timer", self.do_count, 0.01))

Expand Down

0 comments on commit 51ba01b

Please sign in to comment.