diff --git a/docs/source/conf.py b/docs/source/conf.py index 3012d2c..3117a92 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,11 +12,11 @@ # serve to show the default. import sys, os -import sphinx_rtd_theme +#import sphinx_rtd_theme -html_theme = "sphinx_rtd_theme" +html_theme = "bizstyle" -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] sys.path.append(os.path.join(os.path.dirname(__file__), '../../')) diff --git a/docs/source/index.rst b/docs/source/index.rst index 2e258d2..9f4beda 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -18,6 +18,7 @@ API Documentation pypsi.commands.rst pypsi.plugins.rst pypsi.shell.rst + pypsi.completers.rst pypsi.core.rst pypsi.cmdline.rst pypsi.namespace.rst diff --git a/docs/source/pypsi.ansi.rst b/docs/source/pypsi.ansi.rst index 5106d6a..b516d3f 100644 --- a/docs/source/pypsi.ansi.rst +++ b/docs/source/pypsi.ansi.rst @@ -1,9 +1,5 @@ pypsi.ansi - ANSI Escape Code Support ===================================== -.. toctree:: - :numbered: - - .. automodule:: pypsi.ansi :members: diff --git a/docs/source/pypsi.cmdline.rst b/docs/source/pypsi.cmdline.rst index 0ae5e7b..d50b95f 100644 --- a/docs/source/pypsi.cmdline.rst +++ b/docs/source/pypsi.cmdline.rst @@ -1,10 +1,6 @@ pypsi.cmdline - User input processing ===================================== -.. toctree:: - :numbered: - :maxdepth: 2 - .. automodule:: pypsi.cmdline diff --git a/docs/source/pypsi.commands.rst b/docs/source/pypsi.commands.rst index 6059b36..1296da8 100644 --- a/docs/source/pypsi.commands.rst +++ b/docs/source/pypsi.commands.rst @@ -5,13 +5,6 @@ Pypsi Builtin Commands Pypsi ships with several commands that would be useful for any shell. -.. toctree:: - :numbered: - :maxdepth: 2 - - - - .. autoclass:: pypsi.commands.echo.EchoCommand :members: diff --git a/docs/source/pypsi.completers.rst b/docs/source/pypsi.completers.rst new file mode 100644 index 0000000..74ef9b9 --- /dev/null +++ b/docs/source/pypsi.completers.rst @@ -0,0 +1,5 @@ +pypsi.completers - Core tab completion functions +================================================= + +.. automodule:: pypsi.completers + :members: diff --git a/docs/source/pypsi.core.rst b/docs/source/pypsi.core.rst index 3a62b38..e6bd13d 100644 --- a/docs/source/pypsi.core.rst +++ b/docs/source/pypsi.core.rst @@ -1,10 +1,6 @@ pypsi.core - Core classes for pluggable features ================================================ -.. toctree:: - :numbered: - - .. automodule:: pypsi.core diff --git a/docs/source/pypsi.format.rst b/docs/source/pypsi.format.rst index b699b12..4967580 100644 --- a/docs/source/pypsi.format.rst +++ b/docs/source/pypsi.format.rst @@ -1,9 +1,5 @@ pypsi.format - Stream output formatting ======================================= -.. toctree:: - :numbered: - - .. automodule:: pypsi.format :members: diff --git a/docs/source/pypsi.namespace.rst b/docs/source/pypsi.namespace.rst index 0f90dea..6c6df52 100644 --- a/docs/source/pypsi.namespace.rst +++ b/docs/source/pypsi.namespace.rst @@ -1,9 +1,5 @@ pypsi.namespace - Arbitrary attribute storage classes ===================================================== -.. toctree:: - :numbered: - - .. automodule:: pypsi.namespace :members: diff --git a/docs/source/pypsi.plugins.rst b/docs/source/pypsi.plugins.rst index 75eade1..5908cea 100644 --- a/docs/source/pypsi.plugins.rst +++ b/docs/source/pypsi.plugins.rst @@ -4,10 +4,6 @@ Pypsi Builtin Plugins Pypsi ships with several useful plugins that enhance the shell. -.. toctree:: - :numbered: - :maxdepth: 2 - .. automodule:: pypsi.plugins diff --git a/docs/source/pypsi.rst b/docs/source/pypsi.rst deleted file mode 100644 index f23160e..0000000 --- a/docs/source/pypsi.rst +++ /dev/null @@ -1,6 +0,0 @@ - -.. toctree:: - :numbered: - - -.. include:: ../../README.rst diff --git a/docs/source/pypsi.shell.rst b/docs/source/pypsi.shell.rst index 835735d..ae13afd 100644 --- a/docs/source/pypsi.shell.rst +++ b/docs/source/pypsi.shell.rst @@ -2,10 +2,6 @@ pypsi.shell - Pypsi Shell ========================= -.. toctree:: - :numbered: - - .. automodule:: pypsi.shell :members: diff --git a/docs/source/pypsi.utils.rst b/docs/source/pypsi.utils.rst index dfd80c3..d662695 100644 --- a/docs/source/pypsi.utils.rst +++ b/docs/source/pypsi.utils.rst @@ -1,9 +1,5 @@ pypsi.utils - Utility functions =============================== -.. toctree:: - :numbered: - - .. automodule:: pypsi.utils :members: diff --git a/docs/source/pypsi.wizard.rst b/docs/source/pypsi.wizard.rst index f76a04f..d3275e7 100644 --- a/docs/source/pypsi.wizard.rst +++ b/docs/source/pypsi.wizard.rst @@ -1,9 +1,5 @@ pypsi.wizard - Prompt Wizards ============================= -.. toctree:: - :numbered: - - .. automodule:: pypsi.wizard :members: diff --git a/pypsi/cmdline.py b/pypsi/cmdline.py index b2af80c..8db9107 100644 --- a/pypsi/cmdline.py +++ b/pypsi/cmdline.py @@ -508,8 +508,8 @@ def __call__(self, shell): def should_continue(self, prev_rc): ''' :returns: whether this invocation is chained and, using the previous - invocation's return code, determine if the next command in the chain - should be executed. + invocation's return code, determine if the next command in the + chain should be executed. ''' return ( diff --git a/pypsi/completers.py b/pypsi/completers.py index 5c76a63..51f932c 100644 --- a/pypsi/completers.py +++ b/pypsi/completers.py @@ -26,16 +26,18 @@ def command_completer(parser, shell, args, prefix, case_sensitive=False): ''' Completion function that can tab complete options, options' values, and positional parameters. Shell, args, and prefix should be the same - params as passed to the pypsi.core.Command.complete() function - :param parser: A PypsiArgParser object OR an action object returned - from PypsiArgParser.add_subparsers() - :param pypsi.shell.Shell shell: The current Shell object + params as passed to the :meth:`pypsi.core.Command.complete` function + + :param parser: A PypsiArgParser object or an action object returned + from :meth:`PypsiArgParser.add_subparsers` + :param pypsi.shell.Shell shell: The current Shell object :param list args: The full list of current CLI args :param str prefix: The partial arg being completed :param bool case_sensitive: Whether the prefix will be completed - in a case sensitive manner + in a case sensitive manner :return list: A list of possible options based on the prefix ''' + cmd_parser = None offset = 0 completions = [] diff --git a/pypsi/core.py b/pypsi/core.py index e442ca1..2d779ab 100644 --- a/pypsi/core.py +++ b/pypsi/core.py @@ -387,7 +387,7 @@ def pypsi_print(*args, sep=' ', end='\n', file=None, flush=True, width=None, ''' Wraps the functionality of the Python builtin `print` function. The :meth:`pypsi.shell.Shell.bootstrap` overrides the Python :meth:`print` - function with :meth:`pypsi_print`. + function with ``pypsi_print``. :param str sep: string to print between arguments :param str end: string to print at the end of the output diff --git a/pypsi/shell.py b/pypsi/shell.py index da6b32f..0f697a9 100644 --- a/pypsi/shell.py +++ b/pypsi/shell.py @@ -197,6 +197,7 @@ def on_tokenize(self, tokens, origin): def include(self, file): ''' Read commands from a file and execute them line by line + :param file file: File object to read commands from :return int: 0 if error free; 1 if an error occurred '''