Repository URL to install this package:
|
Version:
3.0.176 ▾
|
tvault-contego-common
/
home
/
tvault
/
.virtenv
/
lib
/
python2.7
/
site-packages
/
cliff
/
command.pyc
|
|---|
ó
âEYc @ sy d d l Z d d l Z d d l Z d d l m Z e j e j d e f d Y Z d e j f d YZ
d S( iÿÿÿÿN( t argparset Commandc B sb e Z d Z e Z d Z d Z d d Z d Z d Z
d Z e j
d Z d Z RS( s Base class for command plugins.
:param app: Application instance invoking the command.
:paramtype app: cliff.app.App
t c C s | | _ | | _ | | _ d S( N( t appt app_argst cmd_name( t selfR R R ( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyt __init__# s c C sC | j p t j | j p d } | t j t k r? d } n | S( s Return the command description.
The default is to use the first line of the class' docstring
as the description. Set the ``_description`` class attribute
to a one-line description of a command to use a different
value. This is useful for enabling translations, for example,
with ``_description`` set to a string wrapped with a gettext
translation marker.
R ( t _descriptiont inspectt getdoct __class__R ( R t desc( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyt get_description) s ! c C s | j S( s Return the command epilog.( t _epilog( R ( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyt
get_epilog? s c C s4 t j d | j d | j d | d t } | S( s4 Return an :class:`argparse.ArgumentParser`.
t descriptiont epilogt progt formatter_class( R t ArgumentParserR
R t _SmartHelpFormatter( R t prog_namet parser( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyt
get_parserC s c C s d S( sf Override to do something useful.
The returned value will be returned by the program.
N( ( R t parsed_args( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyt take_actionN s c C s | j | p d S( s Invoked by the application when the command is run.
Developers implementing commands should override
:meth:`take_action`.
Developers creating new command base classes (such as
:class:`Lister` and :class:`ShowOne`) should override this
method to wrap :meth:`take_action`.
Return the value returned by :meth:`take_action` or 0.
i ( R ( R R ( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyt runU s N( t __name__t
__module__t __doc__t Falset
deprecatedR t NoneR R R
R R t abct abstractmethodR R ( ( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyR s R c B s e Z d Z d Z RS( sÓ Smart help formatter to output raw help message if help contain
.
Some command help messages maybe have multiple line content, the built-in
argparse.HelpFormatter wrap and split the content according to width, and
ignore
in the raw help message, it merge multiple line content in one
line to output, that looks messy. SmartHelpFormatter keep the raw help
message format if it contain
, and wrap long line like HelpFormatter
behavior.
c C s^ d | k r | j n | g } g } x0 | D]( } | j t t | j | | q. W| S( Ns
( t
splitlinest extendt superR t _split_lines( R t textt widtht linest
wrap_linest each_line( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyR' o s !
( R R R R' ( ( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyR d s ( R" R t sixt cliffR t
add_metaclasst ABCMetat objectR t
HelpFormatterR ( ( ( sB /home/tvault/.virtenv/lib/python2.7/site-packages/cliff/command.pyt <module>
s N