import logging


LOG = logging.getLogger(__name__)


class ProviderBase(object):
    api = None
    client = None

    def __init__(self):
        pass

    def extend_parser(self, name, parser):
        """
        Extend a Command with options from the Provider API
        """
        try:
            func = getattr(self.api, name + '_parser')
        except AttributeError:
            LOG.warn('Command %s doesn\'t extend options', name)
            return
        func(parser)

    def get_api(self, parsed_args, command):
        """
        Get a Provider Command api
        """

    def get_client(self, *args, **kw):
        """
        Get a Client object
        """
        return self.client(*args, **kw)

import logging


LOG = logging.getLogger(__name__)


class ProviderBase(object):
    api = None
    client = None

    def __init__(self):
        pass

    def extend_parser(self, name, parser):
        """
        Extend a Command with options from the Provider API
        """
        try:
            func = getattr(self.api, name + '_parser')
        except AttributeError:
            LOG.warn('Command %s doesn\'t extend options', name)
            return
        func(parser)

    def get_api(self, parsed_args, command):
        """
        Get a Provider Command api
        """
        raise NotImplementedError

    def get_client(self, *args, **kw):
        """
        Get a Client object
        """
        return self.client(*args, **kw)

Raise if not implemented