The device CLI has many duplicates of the fields tuple and similarly reuses the same tuple of attributes often. These variables could be part of base classes similar to the pattern used for the arguments property in combination with the _arguments variable.
class Example(metaclass=abc.ABCMeta):
"""Arguments property is extensible by child classes"""
_arguments = None
@property
def arguments(self):
if self._arguments is None:
self._arguments = dict()
self._arguments.update({
'--id': Argument(
'-i', help="Example argument attribute",
type=int)
})
return self._arguments
The device CLI has many duplicates of the
fields
tuple and similarly reuses the same tuple of attributes often. These variables could be part of base classes similar to the pattern used for thearguments
property in combination with the_arguments
variable.