all: rename parameters to accessibles in module classes

+ make accesses to <module>.parameters work again

Change-Id: I91c09b0f9f5f28d78cd644f83a96c8772e5977e5
Reviewed-on: https://forge.frm2.tum.de/review/20249
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Tested-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
Enrico Faulhaber
2019-03-27 17:08:57 +01:00
parent 08a92029a9
commit 4068516178
8 changed files with 36 additions and 35 deletions

View File

@ -206,5 +206,10 @@ class ModuleMeta(type):
if attrname[3:] not in newtype.accessibles:
raise ProgrammingError('%r: command %r has to be specified '
'explicitly!' % (name, attrname[3:]))
# provide properties to 'filter' out the parameters/commands
newtype.parameters = dict((k,v) for k,v in newtype.accessibles.items() if isinstance(v, Parameter))
newtype.commands = dict((k,v) for k,v in newtype.accessibles.items() if isinstance(v, Command))
attrs['__constructed__'] = True
return newtype