Skip to content

Commit 0215ff4

Browse files
committed
Fix broken Sphinx documentation
All of the Sphinx autodoc/automethod documentation was broken since the cmd2.Cmd stuff got moved to cmd2.cmd2.Cmd when cmd2 got converted to a multi-file Python package.
1 parent 6b5c23c commit 0215ff4

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

docs/freefeatures.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Both ASCII and UTF-8 encoded unicode text files are supported.
1919

2020
Simply include one command per line, typed exactly as you would inside a ``cmd2`` application.
2121

22-
.. automethod:: cmd2.Cmd.do_load
22+
.. automethod:: cmd2.cmd2.Cmd.do_load
2323

24-
.. automethod:: cmd2.Cmd.do__relative_load
24+
.. automethod:: cmd2.cmd2.Cmd.do__relative_load
2525

26-
.. automethod:: cmd2.Cmd.do_edit
26+
.. automethod:: cmd2.cmd2.Cmd.do_edit
2727

2828

2929
Comments
@@ -297,11 +297,11 @@ the readline history.
297297

298298
``cmd2`` adds the option of making this readline history persistent via optional arguments to ``cmd2.Cmd.__init__()``:
299299

300-
.. automethod:: cmd2.Cmd.__init__
300+
.. automethod:: cmd2.cmd2.Cmd.__init__
301301

302302
``cmd2`` makes a third type of history access available with the **history** command:
303303

304-
.. automethod:: cmd2.Cmd.do_history
304+
.. automethod:: cmd2.cmd2.Cmd.do_history
305305

306306
.. _`Readline Emacs editing mode`: http://readline.kablamo.org/emacs.html
307307

@@ -318,9 +318,9 @@ Misc. pre-defined commands
318318
Several generically useful commands are defined
319319
with automatically included ``do_`` methods.
320320

321-
.. automethod:: cmd2.Cmd.do_quit
321+
.. automethod:: cmd2.cmd2.Cmd.do_quit
322322

323-
.. automethod:: cmd2.Cmd.do_shell
323+
.. automethod:: cmd2.cmd2.Cmd.do_shell
324324

325325
( ``!`` is a shortcut for ``shell``; thus ``!ls``
326326
is equivalent to ``shell ls``.)

docs/hooks.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Application Lifecycle Hook Methods
1818
----------------------------------
1919
The ``preloop`` and ``postloop`` methods run before and after the main loop, respectively.
2020

21-
.. automethod:: cmd2.Cmd.preloop
21+
.. automethod:: cmd2.cmd2.Cmd.preloop
2222

23-
.. automethod:: cmd2.Cmd.postloop
23+
.. automethod:: cmd2.cmd2.Cmd.postloop
2424

2525
Application Lifecycle Attributes
2626
--------------------------------
@@ -41,21 +41,21 @@ Command Processing Hooks
4141

4242
Inside the main loop, every time the user hits <Enter> the line is processed by the ``onecmd_plus_hooks`` method.
4343

44-
.. automethod:: cmd2.Cmd.onecmd_plus_hooks
44+
.. automethod:: cmd2.cmd2.Cmd.onecmd_plus_hooks
4545

4646
As the ``onecmd_plus_hooks`` name implies, there are a number of *hook* methods that can be defined in order to inject
4747
application-specific behavior at various points during the processing of a line of text entered by the user. ``cmd2``
4848
increases the 2 hooks provided by ``cmd`` (**precmd** and **postcmd**) to 6 for greater flexibility. Here are
4949
the various hook methods, presented in chronological order starting with the ones called earliest in the process.
5050

51-
.. automethod:: cmd2.Cmd.preparse
51+
.. automethod:: cmd2.cmd2.Cmd.preparse
5252

53-
.. automethod:: cmd2.Cmd.postparse
53+
.. automethod:: cmd2.cmd2.Cmd.postparse
5454

55-
.. automethod:: cmd2.Cmd.postparsing_precmd
55+
.. automethod:: cmd2.cmd2.Cmd.postparsing_precmd
5656

57-
.. automethod:: cmd2.Cmd.precmd
57+
.. automethod:: cmd2.cmd2.Cmd.precmd
5858

59-
.. automethod:: cmd2.Cmd.postcmd
59+
.. automethod:: cmd2.cmd2.Cmd.postcmd
6060

61-
.. automethod:: cmd2.Cmd.postparsing_postcmd
61+
.. automethod:: cmd2.cmd2.Cmd.postparsing_postcmd

docs/integrating.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,4 @@ several disadvantages, including:
7676

7777
Here is a little more info on ``runcmds_plus_hooks``:
7878

79-
.. automethod:: cmd2.Cmd.runcmds_plus_hooks
80-
81-
82-
83-
79+
.. automethod:: cmd2.cmd2.Cmd.runcmds_plus_hooks

docs/unfreefeatures.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ that module.
114114
``cmd2`` defines a few decorators which change the behavior of
115115
how arguments get parsed for and passed to a ``do_`` method. See the section :ref:`decorators` for more information.
116116

117+
.. _argparse: https://docs.python.org/3/library/argparse.html
117118

118119
poutput, pfeedback, perror, ppaged
119120
==================================
@@ -128,18 +129,18 @@ instead. These methods have these advantages:
128129
- ``.pfeedback()`` destination is controlled by :ref:`quiet` parameter.
129130
- Option to display long output using a pager via ``ppaged()``
130131

131-
.. automethod:: cmd2.Cmd.poutput
132-
.. automethod:: cmd2.Cmd.perror
133-
.. automethod:: cmd2.Cmd.pfeedback
134-
.. automethod:: cmd2.Cmd.ppaged
132+
.. automethod:: cmd2.cmd2.Cmd.poutput
133+
.. automethod:: cmd2.cmd2.Cmd.perror
134+
.. automethod:: cmd2.cmd2.Cmd.pfeedback
135+
.. automethod:: cmd2.cmd2.Cmd.ppaged
135136

136137

137138
color
138139
=====
139140

140141
Text output can be colored by wrapping it in the ``colorize`` method.
141142

142-
.. automethod:: cmd2.Cmd.colorize
143+
.. automethod:: cmd2.cmd2.Cmd.colorize
143144

144145
.. _quiet:
145146

@@ -160,7 +161,7 @@ Presents numbered options to user, as bash ``select``.
160161

161162
``app.select`` is called from within a method (not by the user directly; it is ``app.select``, not ``app.do_select``).
162163

163-
.. automethod:: cmd2.Cmd.select
164+
.. automethod:: cmd2.cmd2.Cmd.select
164165

165166
::
166167

@@ -177,4 +178,3 @@ Presents numbered options to user, as bash ``select``.
177178
2. salty
178179
Sauce? 2
179180
wheaties with salty sauce, yum!
180-

0 commit comments

Comments
 (0)