[Python-checkins] CVS: python/dist/src/Doc/lib libcmd.tex,1.9,1.9.2.1

Tim Peters tim_one@users.sourceforge.net
Sun, 29 Jul 2001 21:08:16 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv9082/descr/dist/src/Doc/lib

Modified Files:
      Tag: descr-branch
	libcmd.tex 
Log Message:
Merge of trunk tag delta date2001-07-28 to date2001-07-30.


Index: libcmd.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcmd.tex,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -d -r1.9 -r1.9.2.1
*** libcmd.tex	2001/07/12 02:09:51	1.9
--- libcmd.tex	2001/07/30 04:08:14	1.9.2.1
***************
*** 12,16 ****
  later be wrapped in a more sophisticated interface.
  
! \begin{classdesc}{Cmd}{}
  A \class{Cmd} instance or subclass instance is a line-oriented
  interpreter framework.  There is no good reason to instantiate
--- 12,16 ----
  later be wrapped in a more sophisticated interface.
  
! \begin{classdesc}{Cmd}{\optional{completekey}}
  A \class{Cmd} instance or subclass instance is a line-oriented
  interpreter framework.  There is no good reason to instantiate
***************
*** 18,21 ****
--- 18,27 ----
  interpreter class you define yourself in order to inherit
  \class{Cmd}'s methods and encapsulate action methods.
+ 
+ The optional argument is the \refmodule{readline} name of a completion
+ key; it defaults to \kbd{Tab}. If \var{completekey} is not \code{None}
+ and \module{readline} is available, command completion is done
+ automatically.
+ 
  \end{classdesc}
  
***************
*** 46,53 ****
  the method \method{do_help()}.  As another special case, a line
  beginning with the character \character{!} is dispatched to the
! method \method{do_shell} (if such a method is defined).
  
! All subclasses of \class{Cmd} inherit a predefined \method{do_help}.
! This method, called with an argument \code{bar}, invokes the
  corresponding method \method{help_bar()}.  With no argument,
  \method{do_help()} lists all available help topics (that is, all
--- 52,69 ----
  the method \method{do_help()}.  As another special case, a line
  beginning with the character \character{!} is dispatched to the
! method \method{do_shell()} (if such a method is defined).
  
! If completion is enabled, completing commands will be done
! automatically, and completing of commands args is done by calling
! \method{complete_foo()} with arguments \var{text}, \var{line},
! \var{begidx}, and \var{endidx}.  \var{text} is the string prefix we
! are attempting to match: all returned matches must begin with it.
! \var{line} is the current input line with leading whitespace removed,
! \var{begidx} and \var{endidx} are the beginning and ending indexes
! of the prefix text, which could be used to provide different
! completion depending upon which position the argument is in.
! 
! All subclasses of \class{Cmd} inherit a predefined \method{do_help()}.
! This method, called with an argument \code{'bar'}, invokes the
  corresponding method \method{help_bar()}.  With no argument,
  \method{do_help()} lists all available help topics (that is, all
***************
*** 73,76 ****
--- 89,98 ----
  \end{methoddesc}
  
+ \begin{methoddesc}{completedefault}{text, line, begidx, endidx}
+ Method called to complete an input line when no command-specific
+ \method{complete_*()} method is available.  By default, it returns an
+ empty list.
+ \end{methoddesc}
+ 
  \begin{methoddesc}{precmd}{}
  Hook method executed just before the command line is interpreted, but
***************
*** 143,148 ****
  A flag, defaulting to true.  If true, \method{cmdloop()} uses
  \function{raw_input()} to display a prompt and read the next command;
! if false, \function{sys.stdout.write()} and
! \function{sys.stdin.readline()} are used. (This means that by
  importing \module{readline}, on systems that support it, the
  interpreter will automatically support Emacs-like line editing 
--- 165,170 ----
  A flag, defaulting to true.  If true, \method{cmdloop()} uses
  \function{raw_input()} to display a prompt and read the next command;
! if false, \method{sys.stdout.write()} and
! \method{sys.stdin.readline()} are used. (This means that by
  importing \module{readline}, on systems that support it, the
  interpreter will automatically support Emacs-like line editing