Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize fields and attribute variables across device CLI #9

Open
Dantali0n opened this issue Jul 10, 2021 · 0 comments
Open

Centralize fields and attribute variables across device CLI #9

Dantali0n opened this issue Jul 10, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Dantali0n
Copy link
Owner

Dantali0n commented Jul 10, 2021

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
@Dantali0n Dantali0n added the enhancement New feature or request label Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant