# Path: cliff/app.py
# _SIGINT_EXIT = 130
# _SIGPIPE_EXIT = 141
#     NAME = os.path.splitext(os.path.basename(sys.argv[0]))[0]
#         NAME = os.path.split(os.path.dirname(sys.argv[0]))[-1]
#     LOG = logging.getLogger(NAME)
#     CONSOLE_MESSAGE_FORMAT = '%(message)s'
#     LOG_FILE_MESSAGE_FORMAT = \
#         '[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
#     DEFAULT_VERBOSE_LEVEL = 1
#     DEFAULT_OUTPUT_ENCODING = 'utf-8'
# class App(object):
#     def __init__(self, description, version, command_manager,
#                  stdin=None, stdout=None, stderr=None,
#                  interactive_app_factory=None,
#                  deferred_help=False):
#     def _set_streams(self, stdin, stdout, stderr):
#     def build_option_parser(self, description, version,
#                             argparse_kwargs=None):
#     def configure_logging(self):
#     def print_help_if_requested(self):
#     def run(self, argv):
#     def initialize_app(self, argv):
#     def prepare_to_run_command(self, cmd):
#     def clean_up(self, cmd, result, err):
#     def interact(self):
#     def get_fuzzy_matches(self, cmd):
#     def run_subcommand(self, argv):
# 
# Path: cliff/commandmanager.py
# LOG = logging.getLogger(__name__)
# def _get_commands_by_partial_name(args, commands):
#     def __init__(self, name, command_class):
#     def load(self, require=False):
#     def __init__(self, namespace, convert_underscores=True):
#     def _load_commands(self):
#     def load_commands(self, namespace):
#     def __iter__(self):
#     def add_command(self, name, command_class):
#     def add_legacy_command(self, old_name, new_name):
#     def find_command(self, argv):
#     def _get_last_possible_command_index(self, argv):
#     def add_command_group(self, group=None):
#     def get_command_groups(self):
#     def get_command_names(self, group=None):
# class EntryPointWrapper(object):
# class CommandManager(object):


import argparse
import fnmatch
import importlib
import inspect
import re
import sys
from docutils import nodes
from docutils.parsers import rst
from docutils.parsers.rst import directives
from docutils import statemachine
from cliff import app
from cliff import commandmanager
        # to the CommandManager itself to allow things like "show me the
        # commands like 'foo *'"
        command_pattern = self.options.get('command')
        manager = commandmanager.CommandManager(self.arguments[0])
        if command_pattern:
            commands = [x for x in manager.commands
                        if fnmatch.fnmatch(x, command_pattern)]
        else:
            commands = manager.commands.keys()

        if not commands:
            msg = 'No commands found in the "{}" namespace'
            if command_pattern:
                msg += ' using the "{}" command name/pattern'
            msg += ('. Are you sure this is correct and the application being '
                    'documented is installed?')
            raise self.warning(msg.format(self.arguments[0], command_pattern))

        return dict((name, self._load_command(manager, name))
                    for name in commands)

    def _generate_app_node(self, app, application_name):
        ignored_opts = self._get_ignored_opts()

        parser = app.parser

        self._drop_ignored_options(parser, ignored_opts)

        parser.prog = application_name


# Path: cliff/app.py
# _SIGINT_EXIT = 130
# _SIGPIPE_EXIT = 141
#     NAME = os.path.splitext(os.path.basename(sys.argv[0]))[0]
#         NAME = os.path.split(os.path.dirname(sys.argv[0]))[-1]
#     LOG = logging.getLogger(NAME)
#     CONSOLE_MESSAGE_FORMAT = '%(message)s'
#     LOG_FILE_MESSAGE_FORMAT = \
#         '[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
#     DEFAULT_VERBOSE_LEVEL = 1
#     DEFAULT_OUTPUT_ENCODING = 'utf-8'
# class App(object):
#     def __init__(self, description, version, command_manager,
#                  stdin=None, stdout=None, stderr=None,
#                  interactive_app_factory=None,
#                  deferred_help=False):
#     def _set_streams(self, stdin, stdout, stderr):
#     def build_option_parser(self, description, version,
#                             argparse_kwargs=None):
#     def configure_logging(self):
#     def print_help_if_requested(self):
#     def run(self, argv):
#     def initialize_app(self, argv):
#     def prepare_to_run_command(self, cmd):
#     def clean_up(self, cmd, result, err):
#     def interact(self):
#     def get_fuzzy_matches(self, cmd):
#     def run_subcommand(self, argv):
# 
# Path: cliff/commandmanager.py
# LOG = logging.getLogger(__name__)
# def _get_commands_by_partial_name(args, commands):
#     def __init__(self, name, command_class):
#     def load(self, require=False):
#     def __init__(self, namespace, convert_underscores=True):
#     def _load_commands(self):
#     def load_commands(self, namespace):
#     def __iter__(self):
#     def add_command(self, name, command_class):
#     def add_legacy_command(self, old_name, new_name):
#     def find_command(self, argv):
#     def _get_last_possible_command_index(self, argv):
#     def add_command_group(self, group=None):
#     def get_command_groups(self):
#     def get_command_names(self, group=None):
# class EntryPointWrapper(object):
# class CommandManager(object):


# Path: cliff/sphinxext.py
import argparse
import fnmatch
import importlib
import inspect
import re
import sys
from docutils import nodes
from docutils.parsers import rst
from docutils.parsers.rst import directives
from docutils import statemachine
from cliff import app
from cliff import commandmanager

        # to the CommandManager itself to allow things like "show me the
        # commands like 'foo *'"
        command_pattern = self.options.get('command')
        manager = commandmanager.CommandManager(self.arguments[0])
        if command_pattern:
            commands = [x for x in manager.commands
                        if fnmatch.fnmatch(x, command_pattern)]
        else:
            commands = manager.commands.keys()

        if not commands:
            msg = 'No commands found in the "{}" namespace'
            if command_pattern:
                msg += ' using the "{}" command name/pattern'
            msg += ('. Are you sure this is correct and the application being '
                    'documented is installed?')
            raise self.warning(msg.format(self.arguments[0], command_pattern))

        return dict((name, self._load_command(manager, name))
                    for name in commands)

    def _generate_app_node(self, app, application_name):
        ignored_opts = self._get_ignored_opts()

        parser = app.parser

        self._drop_ignored_options(parser, ignored_opts)

        parser.prog = application_name


        source_name = '<{}>'.format(app.__class__.__name__)