mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 11:58:55 +00: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:
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):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user