Remove _update method
This commit is contained in:
parent
25f96f57bb
commit
22a982430c
|
@ -62,8 +62,8 @@ class Component(object):
|
||||||
|
|
||||||
def _start(self):
|
def _start(self):
|
||||||
self._state = COMPONENT_STATE.index("Started")
|
self._state = COMPONENT_STATE.index("Started")
|
||||||
if self._update():
|
if hasattr(self, "update"):
|
||||||
self._timer = LoopingCall(self._update)
|
self._timer = LoopingCall(self.update)
|
||||||
self._timer.start(self._interval)
|
self._timer.start(self._interval)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
@ -89,16 +89,6 @@ class Component(object):
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _update(self):
|
|
||||||
try:
|
|
||||||
self.update()
|
|
||||||
except AttributeError:
|
|
||||||
# This will stop the timer since the component doesn't have an
|
|
||||||
# update method.
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
class ComponentRegistry:
|
class ComponentRegistry:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.components = {}
|
self.components = {}
|
||||||
|
|
Loading…
Reference in New Issue