diff --git a/secop/modules.py b/secop/modules.py index 6e89030..8df582e 100644 --- a/secop/modules.py +++ b/secop/modules.py @@ -89,16 +89,17 @@ class HasAccessibles(HasProperties): if isinstance(pobj, Command): # nothing to do for now continue - rfunc = cls.__dict__.get('read_' + pname, None) + rfunc = getattr(cls, 'read_' + pname, None) rfunc_handler = pobj.handler.get_read_func(cls, pname) if pobj.handler else None + not_wrapped = getattr(rfunc, '__wrapped__', False) is False if rfunc_handler: - if rfunc: + if rfunc and not_wrapped: raise ProgrammingError("parameter '%s' can not have a handler " "and read_%s" % (pname, pname)) rfunc = rfunc_handler # create wrapper except when read function is already wrapped - if rfunc is None or getattr(rfunc, '__wrapped__', False) is False: + if rfunc is None or not_wrapped: def wrapped_rfunc(self, pname=pname, rfunc=rfunc): if rfunc: @@ -126,11 +127,12 @@ class HasAccessibles(HasProperties): if not pobj.readonly: wfunc = getattr(cls, 'write_' + pname, None) - if wfunc is None: # ignore the handler, if a write function is present + not_wrapped = getattr(wfunc, '__wrapped__', False) is False + if wfunc is None or not_wrapped: # ignore the handler, if a write function is present wfunc = pobj.handler.get_write_func(pname) if pobj.handler else None # create wrapper except when write function is already wrapped - if wfunc is None or getattr(wfunc, '__wrapped__', False) is False: + if wfunc is None or not_wrapped: def wrapped_wfunc(self, value, pname=pname, wfunc=wfunc): self.log.debug("check validity of %s = %r" % (pname, value)) diff --git a/secop/proxy.py b/secop/proxy.py index 7320e82..325091c 100644 --- a/secop/proxy.py +++ b/secop/proxy.py @@ -122,6 +122,8 @@ class ProxyModule(HasIodev, Module): self.announceUpdate(pname, None, readerror) self.announceUpdate('status', newstatus) + def checkProperties(self): + pass # skip class ProxyReadable(ProxyModule, Readable): pass