revert commits done before MZ holidays
they are all not neccessary for SINQ SE operation Change-Id: Ic9adcccf685752ab90bb6b86005ac8e04b302855
This commit is contained in:
@@ -329,6 +329,7 @@ class Module(HasAccessibles):
|
||||
|
||||
# reference to the dispatcher (used for sending async updates)
|
||||
DISPATCHER = None
|
||||
attachedModules = None
|
||||
pollInfo = None
|
||||
triggerPoll = None # trigger event for polls. used on io modules and modules without io
|
||||
|
||||
@@ -346,9 +347,7 @@ class Module(HasAccessibles):
|
||||
self.accessLock = threading.RLock() # for read_* / write_* methods
|
||||
self.updateLock = threading.RLock() # for announceUpdate
|
||||
self.polledModules = [] # modules polled by thread started in self.startModules
|
||||
self.attachedModules = {}
|
||||
errors = []
|
||||
self._isinitialized = False
|
||||
|
||||
# handle module properties
|
||||
# 1) make local copies of properties
|
||||
@@ -640,13 +639,6 @@ class Module(HasAccessibles):
|
||||
all parameters are polled once
|
||||
"""
|
||||
|
||||
def shutdownModule(self):
|
||||
"""called when the sever shuts down
|
||||
|
||||
any cleanup-work should be performed here, like closing threads and
|
||||
saving data.
|
||||
"""
|
||||
|
||||
def doPoll(self):
|
||||
"""polls important parameters like value and status
|
||||
|
||||
@@ -940,12 +932,10 @@ class Attached(Property):
|
||||
def __get__(self, obj, owner):
|
||||
if obj is None:
|
||||
return self
|
||||
if self.name not in obj.attachedModules:
|
||||
modobj = obj.DISPATCHER.get_module(super().__get__(obj, owner))
|
||||
if not isinstance(modobj, self.basecls):
|
||||
raise ConfigError(f'attached module {self.name}={modobj.name!r} '\
|
||||
f'must inherit from {self.basecls.__qualname__!r}')
|
||||
obj.attachedModules[self.name] = modobj
|
||||
if obj.attachedModules is None:
|
||||
# return the name of the module (called from Server on startup)
|
||||
return super().__get__(obj, owner)
|
||||
# return the module (called after startup)
|
||||
return obj.attachedModules.get(self.name) # return None if not given
|
||||
|
||||
def copy(self):
|
||||
|
||||
Reference in New Issue
Block a user