From 0d43627fd68908aa83bda63506b755f308dd38a5 Mon Sep 17 00:00:00 2001 From: cat Date: Fri, 12 Feb 2010 22:15:04 -0500 Subject: doc refreshing refresh.bash --- docs/freefeatures.rst | 16 ++++++++++++++++ docs/index.rst | 5 +++++ docs/refresh.bash | 7 +++++++ docs/unfreefeatures.rst | 23 +++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100755 docs/refresh.bash (limited to 'docs') diff --git a/docs/freefeatures.rst b/docs/freefeatures.rst index 1f76f28..93be325 100644 --- a/docs/freefeatures.rst +++ b/docs/freefeatures.rst @@ -152,5 +152,21 @@ mental imbalance. (Cmd) speak it was /* not */ delicious! # Yuck! it was delicious! +Misc. pre-defined commands +========================== + +Several generically useful commands are defined +with automatically included ``do_`` methods. + +.. automethod:: cmd2.Cmd.do_quit + +.. automethod:: cmd2.Cmd.do_pause + +.. automethod:: cmd2.Cmd.do_shell + +( ``!`` is a shortcut for ``shell``; thus ``!ls`` +is equivalent to ``shell ls``.) + + Transcript-based testing ======================== diff --git a/docs/index.rst b/docs/index.rst index a348bb4..cc771e5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -20,6 +20,11 @@ The basic use of ``cmd2`` is identical to that of cmd_. app = App() app.cmdloop() + +These docs will refer to ``App`` as your ``cmd2.Cmd`` +subclass, and ``app`` as an instance of ``App``. Of +course, in your program, you may name them whatever +you want. Contents: diff --git a/docs/refresh.bash b/docs/refresh.bash new file mode 100755 index 0000000..fdea359 --- /dev/null +++ b/docs/refresh.bash @@ -0,0 +1,7 @@ +make html +#scp -r build catherine@$tummy:/var/www/sqlpython +cd _build +zip -r cmd2_docs * +mv cmd2_docs.zip .. +cd .. +echo "Upload cmd2_docs.zip to http://pypi.python.org/pypi/cmd2" diff --git a/docs/unfreefeatures.rst b/docs/unfreefeatures.rst index 20193c5..e341fc3 100644 --- a/docs/unfreefeatures.rst +++ b/docs/unfreefeatures.rst @@ -189,3 +189,26 @@ useful for non-essential feedback that the user may not always want to read. ``quiet`` is only relevant if ``app.pfeedback`` is sometimes used. +``select`` +========== + +``app.select`` is called from within a method (not by the user directly; it is ``app.select``, not ``app.do_select``). + +.. automethod:: cmd2.Cmd.select + +:: + + def do_eat(self, arg): + sauce = self.select('sweet salty', 'Sauce? ') + result = '{food} with {sauce} sauce, yum!' + result = result.format(food=arg, sauce=sauce) + self.stdout.write(result + '\n') + +:: + + (Cmd) eat wheaties + 1. sweet + 2. salty + Sauce? 2 + wheaties with salty sauce, yum! + -- cgit v1.2.1