configurables must contain only settable properties
+ bug fix in TCLRequestHandler (decoding error) + cosmetic changes Change-Id: I824e06f1acf975bb59c3312bb97fdfca23e6c975 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21826 Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de> Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
parent
6af440c971
commit
c0c926d9d7
@ -194,10 +194,12 @@ class ModuleMeta(PropertyMeta):
|
|||||||
res = {}
|
res = {}
|
||||||
# collect info about properties
|
# collect info about properties
|
||||||
for pn, pv in cls.properties.items():
|
for pn, pv in cls.properties.items():
|
||||||
res[pn] = pv
|
if pv.settable:
|
||||||
|
res[pn] = pv
|
||||||
# collect info about parameters and their properties
|
# collect info about parameters and their properties
|
||||||
for param, pobj in cls.accessibles.items():
|
for param, pobj in cls.accessibles.items():
|
||||||
res[param] = {}
|
res[param] = {}
|
||||||
for pn, pv in pobj.getProperties().items():
|
for pn, pv in pobj.getProperties().items():
|
||||||
res[param][pn] = pv
|
if pv.settable:
|
||||||
|
res[param][pn] = pv
|
||||||
return res
|
return res
|
||||||
|
@ -198,10 +198,9 @@ class Module(HasProperties, metaclass=ModuleMeta):
|
|||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
self.log.exception(formatExtendedStack())
|
self.log.exception(formatExtendedStack())
|
||||||
raise
|
raise
|
||||||
# raise ConfigError('Module %s: config parameter %r:\n%r' %
|
# raise ConfigError('Module %s: config parameter %r:\n%r' %
|
||||||
# (self.name, k, e))
|
# (self.name, k, e))
|
||||||
# note: this will call write_* methods which will
|
# note: this will NOT call write_* methods!
|
||||||
# write to the hardware, if possible!
|
|
||||||
if k != 'value':
|
if k != 'value':
|
||||||
setattr(self, k, v)
|
setattr(self, k, v)
|
||||||
cfgdict.pop(k)
|
cfgdict.pop(k)
|
||||||
|
@ -122,7 +122,8 @@ class TCPRequestHandler(socketserver.BaseRequestHandler):
|
|||||||
try:
|
try:
|
||||||
msg = decode_msg(origin)
|
msg = decode_msg(origin)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
msg = origin.split(' ',3)
|
# we have to decode 'origin' here. utf-8 and ascii may lead to encoding errors
|
||||||
|
msg = origin.decode('latin-1').split(' ', 3)
|
||||||
result = (ERRORPREFIX + msg[0], msg[1], ['InternalError', str(err),
|
result = (ERRORPREFIX + msg[0], msg[1], ['InternalError', str(err),
|
||||||
{'exception': formatException(),
|
{'exception': formatException(),
|
||||||
'traceback': formatExtendedStack()}])
|
'traceback': formatExtendedStack()}])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user