Add QubesAction

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-05-18 14:55:40 +02:00
parent e757444c35
commit c22d9e88c9
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -40,6 +40,20 @@ import qubes.log
VM_ALL = object() VM_ALL = object()
class QubesAction(argparse.Action):
''' Interface providing a convinience method to be called, after
`namespace.app` is instantiated.
'''
# pylint: disable=too-few-public-methods
def parse_qubes_app(self, parser, namespace):
''' This method is called by :py:class:`qubes.tools.QubesArgumentParser`
after the `namespace.app` is instantiated. Oerwrite this method when
extending :py:class:`qubes.tools.QubesAction` to initialized values
based on the `namespace.app`
'''
raise NotImplementedError
class PropertyAction(argparse.Action): class PropertyAction(argparse.Action):
'''Action for argument parser that stores a property.''' '''Action for argument parser that stores a property.'''
# pylint: disable=redefined-builtin,too-few-public-methods # pylint: disable=redefined-builtin,too-few-public-methods