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 Param(**self.__dict__)
|
||||
|
||||
def as_dict(self):
|
||||
def for_export(self):
|
||||
# used for serialisation only
|
||||
res = dict(
|
||||
description=self.description,
|
||||
@ -172,7 +172,7 @@ class Command(object):
|
||||
return '%s(%s)' % (self.__class__.__name__, ', '.join(
|
||||
['%s=%r' % (k, v) for k, v in sorted(self.__dict__.items())]))
|
||||
|
||||
def as_dict(self):
|
||||
def for_export(self):
|
||||
# used for serialisation only
|
||||
return dict(
|
||||
description=self.description,
|
||||
|
@ -157,7 +157,7 @@ class Dispatcher(object):
|
||||
res = {}
|
||||
for paramname, param in list(self.get_module(modulename).parameters.items()):
|
||||
if param.export:
|
||||
res[paramname] = param.as_dict()
|
||||
res[paramname] = param.for_export()
|
||||
self.log.debug(u'list params for module %s -> %r' %
|
||||
(modulename, res))
|
||||
return res
|
||||
@ -170,7 +170,7 @@ class Dispatcher(object):
|
||||
# omit export=False params!
|
||||
res = {}
|
||||
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))
|
||||
return res
|
||||
self.log.debug(u'-> module is not to be exported!')
|
||||
|
Reference in New Issue
Block a user