diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-03-13 21:40:56 -0400 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-03-13 21:40:56 -0400 |
| commit | 8c1e01886853471d8dadd473f491f310937b01d0 (patch) | |
| tree | f41bf6a8699495575640d0d8fda37d45d0e4d056 /docs | |
| parent | 8b0505c5ccdc7516572afe1426d82666f97232af (diff) | |
| download | cmd2-git-8c1e01886853471d8dadd473f491f310937b01d0.tar.gz | |
Mostly fix a bunch of spelling mistakes.
A few other miscellaneous minor tweaks for whitespace and such.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/alternatives.rst | 2 | ||||
| -rw-r--r-- | docs/conf.py | 37 | ||||
| -rw-r--r-- | docs/freefeatures.rst | 5 | ||||
| -rw-r--r-- | docs/hooks.rst | 10 | ||||
| -rw-r--r-- | docs/install.rst | 1 | ||||
| -rw-r--r-- | docs/overview.rst | 4 | ||||
| -rw-r--r-- | docs/pycon2010/pirate3.py | 1 | ||||
| -rw-r--r-- | docs/pycon2010/pirate4.py | 1 | ||||
| -rw-r--r-- | docs/pycon2010/pirate5.py | 1 | ||||
| -rw-r--r-- | docs/pycon2010/pirate6.py | 1 | ||||
| -rw-r--r-- | docs/pycon2010/pirate7.py | 1 | ||||
| -rw-r--r-- | docs/pycon2010/pirate8.py | 1 |
12 files changed, 37 insertions, 28 deletions
diff --git a/docs/alternatives.rst b/docs/alternatives.rst index 3587b749..bf1545d6 100644 --- a/docs/alternatives.rst +++ b/docs/alternatives.rst @@ -50,4 +50,4 @@ allowing a good experience for end users. If you are seeking a visually richer mind investing more development time, we would recommend checking out `Python Prompt Toolkit`_. In the future, we may investigate options for incorporating the usage of `Python Prompt Toolkit`_ and/or Click_ into -``cmd2`` applicaitons. +``cmd2`` applications. diff --git a/docs/conf.py b/docs/conf.py index 0627f94c..60a28d13 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,29 +1,30 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# -# cmd2 documentation build configuration file, created by -# sphinx-quickstart on Wed Feb 10 12:05:28 2010. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +""" +cmd2 documentation build configuration file, created by +sphinx-quickstart on Wed Feb 10 12:05:28 2010. -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# +This file is execfile()d with the current directory set to its +containing dir. + +Note that not all possible configuration values are present in this +autogenerated file. + +All configuration values have a default; values that are commented out +serve to show the default. + +If extensions (or modules to document with autodoc) are in another directory, +add these directories to sys.path here. If the directory is relative to the +documentation root, use os.path.abspath to make it absolute, like shown here. +""" import os import sys -sys.path.insert(0, os.path.abspath('..')) - # Import for custom theme from Read the Docs import sphinx_rtd_theme +sys.path.insert(0, os.path.abspath('..')) + + # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. diff --git a/docs/freefeatures.rst b/docs/freefeatures.rst index ddde62ca..44ade408 100644 --- a/docs/freefeatures.rst +++ b/docs/freefeatures.rst @@ -67,7 +67,7 @@ quotation marks if it is more than a one-word command. If you wish to disable cmd2's consumption of command-line arguments, you can do so by setting the ``allow_cli_args`` attribute of your ``cmd2.Cmd`` class instance to ``False``. This would be useful, for example, if you wish to use - someting like Argparse_ to parse the overall command line arguments for your application:: + something like Argparse_ to parse the overall command line arguments for your application:: from cmd2 import Cmd class App(Cmd): @@ -278,7 +278,7 @@ expressions. .. note:: - If you have set ``allow_cli_args`` to False in order to disable parsing of command line arguments at invocaiton, + If you have set ``allow_cli_args`` to False in order to disable parsing of command line arguments at invocation, then the use of ``-t`` or ``--test`` to run transcript testing is automatically disabled. In this case, you can alternatively provide a value for the optional ``transcript_files`` when constructing the instance of your ``cmd2.Cmd`` derived class in order to cause a transcript test to run:: @@ -290,3 +290,4 @@ expressions. if __name__ == '__main__': app = App(transcript_files=['exampleSession.txt']) app.cmdloop() + diff --git a/docs/hooks.rst b/docs/hooks.rst index 3849cce0..02f44274 100644 --- a/docs/hooks.rst +++ b/docs/hooks.rst @@ -1,7 +1,7 @@ .. cmd2 documentation for application and command lifecycle and the hooks which are available -cmd2 Application Lifecyle and Hooks -=================================== +cmd2 Application Lifecycle and Hooks +==================================== The typical way of starting a cmd2 application is as follows:: @@ -25,14 +25,14 @@ The ``preloop`` and ``postloop`` methods run before and after the main loop, res Application Lifecycle Attributes -------------------------------- -There are numerous attributes (member variables of the ``cmd2.Cmd``) which have a signficiant effect on the applicaiton +There are numerous attributes (member variables of the ``cmd2.Cmd``) which have a significant effect on the application behavior upon entering or during the main loop. A partial list of some of the more important ones is presented here: - **intro**: *str* - if provided this serves as the intro banner printed once at start of application, after ``preloop`` runs - **allow_cli_args**: *bool* - if True (default), then searches for -t or --test at command line to invoke transcript testing mode instead of a normal main loop and also processes any commands provided as arguments on the command line just prior to entering the main loop - **echo**: *bool* - if True, then the command line entered is echoed to the screen (most useful when running scripts) -- **prompt**: *str* - sets the prompt which is displayed, can be dynamically changed based on applicatoin state and/or +- **prompt**: *str* - sets the prompt which is displayed, can be dynamically changed based on application state and/or command results @@ -44,7 +44,7 @@ Inside the main loop, every time the user hits <Enter> the line is processed by .. automethod:: cmd2.Cmd.onecmd_plus_hooks As the ``onecmd_plus_hooks`` name implies, there are a number of *hook* methods that can be defined in order to inject -applicaiton-specific behavior at various points during the processing of a line of text entered by the user. ``cmd2`` +application-specific behavior at various points during the processing of a line of text entered by the user. ``cmd2`` increases the 2 hooks provided by ``cmd`` (**precmd** and **postcmd**) to 6 for greater flexibility. Here are the various hook methods, presented in chronological order starting with the ones called earliest in the process. diff --git a/docs/install.rst b/docs/install.rst index dae100a9..78b330fc 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -122,3 +122,4 @@ Uninstalling cmd2 If you wish to permanently uninstall ``cmd2``, this can also easily be done with pip_:: pip uninstall cmd2 + diff --git a/docs/overview.rst b/docs/overview.rst index 9e7a315a..75b8caa9 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -20,8 +20,8 @@ differs from cmd_. The `cmd.emptyline() <https://docs.python.org/3/library/cmd.html#cmd.Cmd.emptyline>`_ function is called when an empty line is entered in response to the prompt. By default, in cmd_ if this method is not overridden, it repeats and executes the last nonempty command entered. However, no end user we have encountered views this as - expected or desirable default behavior. Thus, the default behvior in ``cmd2`` is to simply go to the next line + expected or desirable default behavior. Thus, the default behavior in ``cmd2`` is to simply go to the next line and issue the prompt again. At this time, cmd2 completely ignores empty lines and the base class cmd.emptyline() - method never gets called and thus the emptyline() behavior cannot be overriden. + method never gets called and thus the emptyline() behavior cannot be overridden. .. _cmd: https://docs.python.org/3/library/cmd.html diff --git a/docs/pycon2010/pirate3.py b/docs/pycon2010/pirate3.py index ecc70f3f..46f26501 100644 --- a/docs/pycon2010/pirate3.py +++ b/docs/pycon2010/pirate3.py @@ -6,6 +6,7 @@ from cmd import Cmd class Pirate(Cmd): gold = 3 + initial_gold = gold def do_loot(self, arg): 'Seize booty from a passing ship.' diff --git a/docs/pycon2010/pirate4.py b/docs/pycon2010/pirate4.py index a4e4816d..ae1e1f4b 100644 --- a/docs/pycon2010/pirate4.py +++ b/docs/pycon2010/pirate4.py @@ -6,6 +6,7 @@ from cmd import Cmd class Pirate(Cmd): gold = 3 + initial_gold = gold def do_loot(self, arg): 'Seize booty from a passing ship.' diff --git a/docs/pycon2010/pirate5.py b/docs/pycon2010/pirate5.py index 2167c7f4..68da88a5 100644 --- a/docs/pycon2010/pirate5.py +++ b/docs/pycon2010/pirate5.py @@ -6,6 +6,7 @@ from cmd import Cmd class Pirate(Cmd): gold = 3 + initial_gold = gold def do_loot(self, arg): 'Seize booty from a passing ship.' diff --git a/docs/pycon2010/pirate6.py b/docs/pycon2010/pirate6.py index a90c2b52..bd5f5fe2 100644 --- a/docs/pycon2010/pirate6.py +++ b/docs/pycon2010/pirate6.py @@ -6,6 +6,7 @@ from cmd2 import Cmd class Pirate(Cmd): gold = 3 + initial_gold = gold prompt = 'arrr> ' def default(self, line): diff --git a/docs/pycon2010/pirate7.py b/docs/pycon2010/pirate7.py index a333070c..799f73ed 100644 --- a/docs/pycon2010/pirate7.py +++ b/docs/pycon2010/pirate7.py @@ -6,6 +6,7 @@ from cmd2 import Cmd class Pirate(Cmd): gold = 3 + initial_gold = gold prompt = 'arrr> ' def default(self, line): diff --git a/docs/pycon2010/pirate8.py b/docs/pycon2010/pirate8.py index 55d6df5c..58b56208 100644 --- a/docs/pycon2010/pirate8.py +++ b/docs/pycon2010/pirate8.py @@ -6,6 +6,7 @@ from cmd2 import Cmd, options, make_option class Pirate(Cmd): gold = 3 + initial_gold = gold prompt = 'arrr> ' def default(self, line): |
