/usr/lib/python2.6/site-packages/cliff
NameSizeModeActions
formatters/-0755rm
tests/-0755rm
app.py147930644editdlrm
app.pyc120720644editdlrm
argparse.py6130644editdlrm
argparse.pyc11150644editdlrm
command.py13750644editdlrm
command.pyc22200644editdlrm
commandmanager.py30480644editdlrm
commandmanager.pyc37800644editdlrm
complete.py51760644editdlrm
complete.pyc78700644editdlrm
display.py31780644editdlrm
display.pyc41990644editdlrm
help.py31240644editdlrm
help.pyc32440644editdlrm
interactive.py51370644editdlrm
interactive.pyc54170644editdlrm
lister.py19470644editdlrm
lister.pyc22490644editdlrm
show.py16350644editdlrm
show.pyc22590644editdlrm
utils.py29500644editdlrm
utils.pyc19750644editdlrm
__init__.py00644editdlrm
__init__.pyc1320644editdlrm
Edit: /usr/lib/python2.6/site-packages/cliff/app.pyc (12072B)
Ñò yDVc@sdZddkZddkZddkZddkZddkZddkZddkZddkZddk Z ddk l Z ddk l Z lZddklZlZeedƒo eiZndeifd„ƒYZeid ƒieƒƒd efd „ƒYZdS( sApplication base class. iÿÿÿÿNi(tCompleteCommand(t HelpActiont HelpCommand(tdamerau_levenshteintCOSTt NullHandlercBs#eZd„Zd„Zd„ZRS(cCsdS(N((tselftrecord((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pythandlescCsdS(N((RR((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pytemitscCs d|_dS(N(tNonetlock(R((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pyt createLock s(t__name__t __module__RR R (((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pyRs  tclifftAppcBsÜeZdZeiieiieidƒƒdZ e i e ƒZ dZ dZdZdZdddded„Zd„Zdd„Zd „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„ZRS(søApplication base class. :param description: one-liner explaining the program purpose :paramtype description: str :param version: application version number :paramtype version: str :param command_manager: plugin loader :paramtype command_manager: cliff.commandmanager.CommandManager :param stdin: Standard input stream :paramtype stdin: readable I/O stream :param stdout: Standard output stream :paramtype stdout: writable I/O stream :param stderr: Standard error output stream :paramtype stderr: writable I/O stream :param interactive_app_factory: callable to create an interactive application :paramtype interactive_app_factory: cliff.interactive.InteractiveApp is %(message)ss2[%(asctime)s] %(levelname)-8s %(name)s %(message)sisutf-8c Cs||_|iidtƒ|iidtƒ|i|||ƒ||_||_|i||ƒ|_t |_ d|_ dS(s$Initialize the application. thelptcompleteN( tcommand_managert add_commandRRt _set_streamstinteractive_app_factoryt deferred_helptbuild_option_parsertparsertFalsetinteractive_modeR t interpreter( Rt descriptiontversionRtstdintstdouttstderrRR((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pyt__init__Cs    cCs#ytitidƒWntij onXtid djo¢tiƒ\}}ttiddƒp|p|i }|pt i |ƒti ƒ|_ |pt i|ƒtiƒ|_|pt i|ƒtiƒ|_n:|pti |_ |pti|_|pti|_dS(Ntiitencoding(ii(tlocalet setlocaletLC_ALLtErrortsyst version_infotgetdefaultlocaletgetattrR R tDEFAULT_OUTPUT_ENCODINGtcodecst getreaderRt getwriterR!(RRR R!tlangR$((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pyRSs ""&c Cs7|ph}tid|dt|}|idddddi|ƒƒ|idddd d d d |id dƒ|idddd d!d dƒ|iddddd d ddd dƒ|io&|iddd dddd dƒn)|idddtddd |d dƒ|idd tddd d ƒ|S("s Return an argparse option parser for this application. Subclasses may override this method to extend the parser with more global options. :param description: full description of the application :paramtype description: str :param version: version number for the application :paramtype version: str :param argparse_kwargs: extra keyword argument passed to the ArgumentParser constructor :paramtype extra_kwargs: dict Rtadd_helps --versiontactionRs %(prog)s {0}s-vs --verbosetcounttdestt verbose_leveltdefaultRs.Increase verbosity of output. Can be repeated.s --log-filetstores2Specify a file to log output. Disabled by default.s-qs--quiett store_consttconstis+Suppress output except warnings and errors.s-hs--helpRt store_truesShow help message and exit.tnargss Show this help message and exit.s--debugsShow tracebacks on errors.N( targparsetArgumentParserRt add_argumenttformattDEFAULT_VERBOSE_LEVELR RR(RRRtargparse_kwargsR((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pyRksX          cCsütidƒ}|itiƒ|iioHtid|iiƒ}ti|iƒ}|i |ƒ|i |ƒnti |i ƒ}hti d6tid6tid6i|iitiƒ}|i|ƒti|iƒ}|i |ƒ|i |ƒdS(s4Create logging handlers for any log output. R#tfilenameiiiN(tloggingt getLoggertsetLeveltDEBUGtoptionstlog_filet FileHandlert FormattertLOG_FILE_MESSAGE_FORMATt setFormattert addHandlert StreamHandlerR!tWARNINGtINFOtgetR6tCONSOLE_MESSAGE_FORMAT(Rt root_loggert file_handlert formattertconsolet console_level((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pytconfigure_logging°s$         cCsM|io?|iio2tddd|ƒ}||i|iddƒndS(s‹Print help and exits if deferred help is enabled and requested. '--help' shows the help message and exits: * without calling initialize_app if not self.deferred_help (default), * after initialize_app call if self.deferred_help, * during initialize_app call if self.deferred_help and subclass calls explicitly this method in initialize_app. R7N(RRHRR R(RR3((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pytprint_help_if_requestedËs cCs(yˆ|ii|ƒ\|_}|iƒ| |_|io4|iio'|o t|i_|iddƒn|i|ƒ|i ƒWnjt j o^}t |dƒo|ii }nt }|o|ii|ƒ‚n|ii|ƒdSXd}|io|iƒ}n|i|ƒ}|S(s“Equivalent to the main program for the application. :param argv: input arguments and options :paramtype argv: list of str iRRHi(Rtparse_known_argsRHRYRRRtinserttinitialize_appRZt ExceptionthasattrtdebugtTruetLOGt exceptionterrortinteracttrun_subcommand(Rtargvt remainderterrR`tresult((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pytrunØs.     cCsdS(s5Hook for subclasses to take global initialization action after the arguments are parsed but before a command is run. Invoked only once, even in interactive mode. :param argv: List of arguments, including the subcommand to run. Empty for interactive mode. N((RRg((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pyR]scCsdS(s¡Perform any preliminary work needed to run a command. :param cmd: command processor being invoked :paramtype cmd: cliff.command.Command N((Rtcmd((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pytprepare_to_run_commandscCsdS(s3Hook run after a command is done to shutdown the app. :param cmd: command processor being invoked :paramtype cmd: cliff.command.Command :param result: return value of cmd :paramtype result: int :param err: exception or None :paramtype err: Exception N((RRlRjRi((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pytclean_ups cCsbddkl}|idjo ||_n|i||i|i|iƒ|_|iiƒdS(Ni(tInteractiveAppi( t interactiveRoRR RRR Rtcmdloop(RRo((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pyRe"s   c Cspd}|iio d}ng}|iD]}||dq+~}g}xtt|ƒD]f}|i|ƒd}|i|ƒo|i|dfƒqXn|i|t||tƒdfƒqXWt|dti ddƒƒ}g} d} x3|| dp#| i|| dƒ| d7} qïW|| d} x9|| d| jo#| i|| dƒ| d7} q3W| S(s0return fuzzy matches of unknown command t_t iitkey( Rtconvert_underscorestsortedtsplitt startswithtappendRRtoperatort itemgetter( RRltsept_[1]tktall_cmdstdistt candidatetprefixtmatchestitbest_similarity((s(/tmp/pip-build-lt8jXN/cliff/cliff/app.pytget_fuzzy_matches0s2  ( 'c Csêy|ii|ƒ}Wnãtj o×}|d}|i|ƒ}|o‰d}|iddjo d}n|iid|i|||i|ifƒ|iidƒxJ|D]}|iid|ƒq°Wn%|iio‚n|i i |ƒdSX|\}} } h} d t i |i ƒijo| | d s"