1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-06-15 04:46:14 +01:00

fw/plugin: implement __str__ for Plugin

Implement __str__ for Plugin in order to provide more readable
representations in logging.
This commit is contained in:
Sergei Trofimov
2018-05-09 16:20:16 +01:00
committed by Marc Bonnici
parent 2c28d5b214
commit b41c3a3ea2

@ -361,6 +361,16 @@ class Plugin(object):
self.capabilities.append(capability)
self._modules.append(module)
def __str__(self):
return self.name
def __repr__(self):
params = []
for param in self.parameters:
params.append('{}={}'.format(param.name,
getattr(self, param.name, None)))
return '{}({})'.format(self.name, ', '.join(params))
class TargetedPlugin(Plugin):
"""