Ζ
ΚMφ9c       s@   d  Z  d k Z d Z e i e i d Z d f  d     YZ d S(   s#  A generic class to build line-oriented command interpreters.

Interpreters constructed with this class obey the following conventions:

1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
   of characters in the identchars member.
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
   is passed a single argument consisting of the remainder of the line.
4. Typing an empty line repeats the last command.  (Actually, it calls the
   method `emptyline', which may be overridden in a subclass.)
5. There is a predefined `help' method.  Given an argument `topic', it
   calls the command `help_topic'.  With no arguments, it lists all topics
   with defined help_ functions, broken into up to three topics; documented
   commands, miscellaneous help topics, and undocumented commands.
6. The command '?' is a synonym for `help'.  The command '!' is a synonym
   for `shell', if a do_shell method exists.

The `default' method may be overridden to intercept commands for which there
is no do_ method.

The data member `self.ruler' sets the character used to draw separator lines
in the help messages.  If empty, no ruler line is drawn.  It defaults to "=".

If the value of `self.intro' is nonempty when the cmdloop method is called,
it is printed out on interpreter startup.  This value may be overridden
via an optional argument to the cmdloop() method.

The data members `self.doc_header', `self.misc_header', and
`self.undoc_header' set the headers used for the help function's
listings of documented functions, miscellaneous topics, and undocumented
functions respectively.

These interpreters use raw_input; thus, if the readline module is loaded,
they automatically support Emacs-like command history and editing features.
Ns   (Cmd) s   _s   Cmdc      sͺ   e  Z e Z d Z d Z g  Z e Z d Z	 d Z
 d Z d Z d Z d   Z e d  Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   Ns   =s    s(   Documented commands (type help <topic>):s   Miscellaneous help topics:s   Undocumented commands:s   *** No help on %sc    s   d  S(   N(    (   s   selfs    /mit/python/lib/python2.0/cmd.pys   __init__8 s    c    sβ   |  i   | t j o | |  _ n |  i o |  i GHn t } x | o |  i o |  i d } |  i d =n0 y t |  i  } Wn t	 j
 o d } n X|  i
 |  } |  i |  } |  i | |  } qC W|  i   d  S(   Ni    s   EOF(   s   selfs   preloops   intros   Nones   stops   cmdqueues   lines	   raw_inputs   prompts   EOFErrors   precmds   onecmds   postcmds   postloop(   s   selfs   intros   stops   lines    /mit/python/lib/python2.0/cmd.pys   cmdloop: s&    

 
c    s   | Sd  S(   N(   s   line(   s   selfs   lines    /mit/python/lib/python2.0/cmd.pys   precmdO s    c    s   | Sd  S(   N(   s   stop(   s   selfs   stops   lines    /mit/python/lib/python2.0/cmd.pys   postcmdR s    c    s   d  S(   N(    (   s   selfs    /mit/python/lib/python2.0/cmd.pys   preloopU s    c    s   d  S(   N(    (   s   selfs    /mit/python/lib/python2.0/cmd.pys   postloopX s    c    si  t  i |  } | o |  i   Snh | d d j o d | d } nE | d d j o3 t |  d  o d | d } n |  i |  Sn | |  _ d t |  f \ } } x0 | | j  o | | |  i j o | d } q° W| |  t  i | |  f \ } } | d j o |  i |  SnE y t |  d	 |  } Wn  t j
 o |  i |  Sn X| |  Sd  S(
   Ni    s   ?s   help i   s   !s   do_shells   shell s    s   do_(   s   strings   strips   lines   selfs	   emptylines   hasattrs   defaults   lastcmds   lens   is   ns
   identcharss   cmds   args   getattrs   funcs   AttributeError(   s   selfs   lines   is   ns   cmds   args   funcs    /mit/python/lib/python2.0/cmd.pys   onecmd[ s,    	 ! #c    s"   |  i o |  i |  i  Sn d  S(   N(   s   selfs   lastcmds   onecmd(   s   selfs    /mit/python/lib/python2.0/cmd.pys	   emptylines s    
c    s   d G| GHd  S(   Ns   *** Unknown syntax:(   s   line(   s   selfs   lines    /mit/python/lib/python2.0/cmd.pys   defaultw s    c    s;  | ow y t |  d |  } WnR y. t |  d |  i } | o | GHd  Sn Wn n X|  i | f GHd  Sn X|   nΊg  } |  i g } xN | oF | d } | i o | t | i  } n | t |  } | d =q Wg  } g  } h  }	 x3 | d r) }
 |
 d  d j o d |	 |
 d <n qό W| i   d } x’ | d r }
 |
 d  d j o |
 | j o qBn |
 } |
 d } |	 i |  o | i |  |	 | =n2 t |  |
  i o | i |  n | i |  n qBW|  i GH|  i |  i | d d	  |  i |  i |	 i   d d	  |  i |  i | d d	  d  S(
   Ns   help_s   do_i    i   i   s    i   i   iP   (   s   args   getattrs   selfs   funcs   __doc__s   docs   nohelps   namess	   __class__s   classess   aclasss	   __bases__s   lists   dirs   cmds_docs
   cmds_undocs   helps   names   sorts   prevnames   cmds   has_keys   appends
   doc_leaders   print_topicss
   doc_headers   misc_headers   keyss   undoc_header(   s   selfs   args   funcs   docs   namess   classess   aclasss   cmds_docs
   cmds_undocs   helps   names   prevnames   cmds    /mit/python/lib/python2.0/cmd.pys   do_helpz sb     

	 
	 
c 	   s   | o | GH|  i o |  i t |  GHn t | |  \ } } | } xA | d r7 } | d j o Hn d | d | G| d | } qP Wd GHn d  S(   Ni    s   %-s   si   s   
(   s   cmdss   headers   selfs   rulers   lens   divmods   maxcols   cmdlens   cmds_per_lines   junks   cols   cmd(	   s   selfs   headers   cmdss   cmdlens   maxcols   cmds_per_lines   junks   cols   cmds    /mit/python/lib/python2.0/cmd.pys   print_topics° s    
	  (   s   PROMPTs   prompts
   IDENTCHARSs
   identcharss   rulers   lastcmds   cmdqueues   Nones   intros
   doc_leaders
   doc_headers   misc_headers   undoc_headers   nohelps   __init__s   cmdloops   precmds   postcmds   preloops   postloops   onecmds	   emptylines   defaults   do_helps   print_topics(    s    /mit/python/lib/python2.0/cmd.pys   Cmd+ s,    									6(   s   __doc__s   strings   PROMPTs   letterss   digitss
   IDENTCHARSs   Cmd(    s    /mit/python/lib/python2.0/cmd.pys   ?$ s   	