???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
¿œ^c           @   s<   d  Z  d d d „  ƒ  YZ d „  Z e d k r8 e ƒ  n  d S(   sH   Framework for command line interfaces like CVS.  See class CmdFrameWork.t   CommandFrameWorkc           B   s\   e  Z d  Z d Z d	 Z d Z d „  Z d	 d „ Z d „  Z	 d „  Z
 d	 d „ Z d „  Z RS(
   só  Framework class for command line interfaces like CVS.

    The general command line structure is

            command [flags] subcommand [subflags] [argument] ...

    There's a class variable GlobalFlags which specifies the
    global flags options.  Subcommands are defined by defining
    methods named do_<subcommand>.  Flags for the subcommand are
    defined by defining class or instance variables named
    flags_<subcommand>.  If there's no command, method default()
    is called.  The __doc__ strings for the do_ methods are used
    for the usage message, printed after the general usage message
    which is the class variable UsageMessage.  The class variable
    PostUsageMessage is printed after all the do_ methods' __doc__
    strings.  The method's return value can be a suggested exit
    status.  [XXX Need to rewrite this to clarify it.]

    Common usage is to derive a class, instantiate it, and then call its
    run() method; by default this takes its arguments from sys.argv[1:].
    s;   usage: (name)s [flags] subcommand [subflags] [argument] ...t    c         C   s   d S(   s&   Constructor, present for completeness.N(    (   t   self(    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyt   __init__#   s    c         C   sŒ  d d l  } d d l } | d k r4 | j d } n  y | j  | |  j ƒ \ } } Wn  | j k
 ru } |  j | ƒ SX|  j | ƒ | s |  j ƒ  |  j	 ƒ  S| d } d | } d | } y t
 |  | ƒ }	 Wn" t k
 rò |  j d | f ƒ SXy t
 |  | ƒ }
 Wn t k
 rd }
 n Xy  | j  | d |
 ƒ \ } } Wn. | j k
 rp} |  j d	 | t | ƒ ƒ SX|  j ƒ  |	 | | ƒ Sd S(
   s3   Process flags, subcommand and options, then run it.iÿÿÿÿNi   i    t   do_t   flags_s   command %r unknownR   s   subcommand %s: (   t   getoptt   syst   Nonet   argvt   GlobalFlagst   errort   usaget   optionst   readyt   defaultt   getattrt   AttributeErrort   str(   R   t   argsR   R   t   optst   msgt   cmdt   mnamet   fnamet   methodt   flags(    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyt   run'   s:     





 
c         C   sR   | rN d d GHd GHx+ | D]# \ } } d G| Gd Gt  | ƒ GHq Wd d GHn  d S(   sW   Process the options retrieved by getopt.
        Override this if you have any options.t   -i(   s   Options:t   optiont   valueN(   t   repr(   R   R   t   ot   a(    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyR   G   s    	c         C   s   d S(   s*   Called just before calling the subcommand.N(    (   R   (    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyR   Q   s    c         C   s%  | r | GHn  |  j  i |  j j d 6GHi  } |  j } x– xu t | ƒ D]g } | d  d k rF | j | ƒ rq qF n  y t | | ƒ j } Wn d } n X| r­ | | | <q­ qF qF W| j s¾ Pn  | j d } q9 W| rd GH| j	 ƒ  } | j
 ƒ  x | D] } | | GHq÷ Wn  |  j r!|  j GHn  d S(   s4   Print usage message.  Return suitable exit code (2).t   namei   R   i    s   where subcommand can be:i   N(   t   UsageMessaget	   __class__t   __name__t   dirt   has_keyR   t   __doc__R   t	   __bases__t   keyst   sortt   PostUsageMessage(   R   R   t
   docstringst   cR"   t   doct   names(    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyR   U   s8     	
	
	c         C   s	   d GHd S(   s\   Default method, called when no subcommand is given.
        You should always override this.s'   Nobody expects the Spanish Inquisition!N(    (   R   (    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyR   s   s    N(   R%   t
   __module__R(   R#   R   R,   R
   R   R   R   R   R   R   (    (    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyR       s   	 	
	c          C   s’   d d l  }  d t f d „  ƒ  Y} | ƒ  } g  d g d g d g d d g d g } x9 | D]1 } d G| Gd GH| j | ƒ } d
 Gt | ƒ GHqY Wd S(   s:   Test script -- called when this module is run as a script.iÿÿÿÿNt   Helloc           B   s   e  Z d  „  Z RS(   c         S   s	   d GHd S(   s0   hello -- print 'hello world', needs no argumentss   Hello, worldN(    (   R   R   R   (    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyt   do_hello}   s    (   R%   R1   R3   (    (    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyR2   |   s   t   hellot   spams   -xR   i
   s   Exit status:s
   ----------s
   ----------(   R   R    R   R   R   (   R   R2   t   xt   testst   tt   sts(    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyt   testy   s    			t   __main__N(    (   R(   R    R:   R%   (    (    (    s(   /usr/lib64/python2.7/Demo/pdist/cmdfw.pyt   <module>   s   u	