rename as_dict methods to for_export
Change-Id: Id86c8cce35d133afeef913c6f868770bc4dcfc3e Reviewed-on: https://forge.frm2.tum.de/review/18209 Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de> Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
@ -116,7 +116,7 @@ class Param(object):
|
|||||||
# return a copy of ourselfs
|
# return a copy of ourselfs
|
||||||
return Param(**self.__dict__)
|
return Param(**self.__dict__)
|
||||||
|
|
||||||
def as_dict(self):
|
def for_export(self):
|
||||||
# used for serialisation only
|
# used for serialisation only
|
||||||
res = dict(
|
res = dict(
|
||||||
description=self.description,
|
description=self.description,
|
||||||
@ -172,7 +172,7 @@ class Command(object):
|
|||||||
return '%s(%s)' % (self.__class__.__name__, ', '.join(
|
return '%s(%s)' % (self.__class__.__name__, ', '.join(
|
||||||
['%s=%r' % (k, v) for k, v in sorted(self.__dict__.items())]))
|
['%s=%r' % (k, v) for k, v in sorted(self.__dict__.items())]))
|
||||||
|
|
||||||
def as_dict(self):
|
def for_export(self):
|
||||||
# used for serialisation only
|
# used for serialisation only
|
||||||
return dict(
|
return dict(
|
||||||
description=self.description,
|
description=self.description,
|
||||||
|
@ -157,7 +157,7 @@ class Dispatcher(object):
|
|||||||
res = {}
|
res = {}
|
||||||
for paramname, param in list(self.get_module(modulename).parameters.items()):
|
for paramname, param in list(self.get_module(modulename).parameters.items()):
|
||||||
if param.export:
|
if param.export:
|
||||||
res[paramname] = param.as_dict()
|
res[paramname] = param.for_export()
|
||||||
self.log.debug(u'list params for module %s -> %r' %
|
self.log.debug(u'list params for module %s -> %r' %
|
||||||
(modulename, res))
|
(modulename, res))
|
||||||
return res
|
return res
|
||||||
@ -170,7 +170,7 @@ class Dispatcher(object):
|
|||||||
# omit export=False params!
|
# omit export=False params!
|
||||||
res = {}
|
res = {}
|
||||||
for cmdname, cmdobj in list(self.get_module(modulename).commands.items()):
|
for cmdname, cmdobj in list(self.get_module(modulename).commands.items()):
|
||||||
res[cmdname] = cmdobj.as_dict()
|
res[cmdname] = cmdobj.for_export()
|
||||||
self.log.debug(u'list cmds for module %s -> %r' % (modulename, res))
|
self.log.debug(u'list cmds for module %s -> %r' % (modulename, res))
|
||||||
return res
|
return res
|
||||||
self.log.debug(u'-> module is not to be exported!')
|
self.log.debug(u'-> module is not to be exported!')
|
||||||
|
Reference in New Issue
Block a user