Esempio n. 1
0
    def _parser(self, version):
        """Create a top level argument parser.

        :param version: version of Tuskar API (and corresponding CLI
            commands) to use
        """
        parser = self._nonversioned_parser()
        subparsers = parser.add_subparsers(metavar="<subcommand>")
        versioned_shell = utils.import_versioned_module(version, "shell")
        versioned_shell.enhance_parser(parser, subparsers)
        return parser
Esempio n. 2
0
    def _parser(self, version):
        '''Create a top level argument parser.

        :param version: version of Tuskar API (and corresponding CLI
            commands) to use
        '''
        parser = self._nonversioned_parser()
        subparsers = parser.add_subparsers(metavar='<subcommand>')
        versioned_shell = utils.import_versioned_module(version, 'shell')
        versioned_shell.enhance_parser(parser, subparsers)
        return parser
    def _parser(self, version):
        '''Create a top level argument parser.

        :param version: version of Tuskar API (and corresponding CLI
            commands) to use
        :return: main parser and subparsers
        :rtype: (Parser, Subparsers)
        '''
        parser = self._nonversioned_parser()
        subparsers = parser.add_subparsers(metavar='<subcommand>')
        versioned_shell = utils.import_versioned_module(version, 'shell')
        versioned_shell.enhance_parser(parser, subparsers)
        utils.define_commands_from_module(subparsers, self)
        return parser, subparsers
Esempio n. 4
0
def Client(version, *args, **kwargs):
    module = utils.import_versioned_module(version, "client")
    client_class = getattr(module, "Client")
    return client_class(*args, **kwargs)
Esempio n. 5
0
def Client(version, *args, **kwargs):
    module = utils.import_versioned_module(version, 'client')
    client_class = getattr(module, 'Client')
    return client_class(*args, **kwargs)