ó [Z-Lc@s¾dZdZddd!ZddlZddlZddlZddlZyddlmZWn!e k r€ddl mZnXddl m Z d e fd „ƒYZd d d „ƒYZdS(s1Provides a command line interface to compiled Cheetah template modules. Meta-Data ================================================================================ Author: Tavis Rudd Version: $Revision: 1.13 $ Start Date: 2001/12/06 Last Revision Date: $Date: 2006/01/10 20:34:35 $ s!Tavis Rudd s$Revision: 1.13 $i iþÿÿÿiÿÿÿÿN(tload(tVersiontErrorcBseZRS((t__name__t __module__(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/TemplateCmdLineIface.pyRst CmdLineIfacecBsReZdZejjejdƒejdd„Zd„Z d„Z d„Z RS(s>A command line interface to compiled Cheetah template modules.iicCs||_||_||_dS(N(t _templatet _scriptNamet _cmdLineArgs(tselft templateObjt scriptNamet cmdLineArgs((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/TemplateCmdLineIface.pyt__init__ s  cCs|jƒ|jGHdS(sThe main program controller.N(t_processCmdLineArgsR(R ((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/TemplateCmdLineIface.pytrun(s cCsUy1tj|jddddgƒ\|_|_Wn3tjk rf}|GH|jƒGHtjdƒnXxç|jD]Ü\}}|d kr¡|jƒGHtjƒn|dkrÌ|jj ƒj d t j ƒn|d krq|d krt tjƒ}|jj ƒj d |ƒqMt|ƒ}t |ƒ}|jƒ|jj ƒj d |ƒqqqqWdS( Nththelptenvspickle=is-hs--helps--envis--picklet-(s-hs--help(tgetoptRt_optst_argst GetoptErrortusagetsystexitRt searchListtinserttostenvironRtstdintopentclose(R tvtotat unpickledtf((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/TemplateCmdLineIface.pyR.s.           cCsdi|jd6td6S(Ns‡Cheetah %(Version)s template module command-line interface Usage ----- %(scriptName)s [OPTION] Options ------- -h, --help Print this help information --env Use shell ENVIRONMENT variables to fill the $placeholders in the template. --pickle Use a variables from a dictionary stored in Python pickle file to fill $placeholders in the template. If is - stdin is used: '%(scriptName)s --pickle -' Description ----------- This interface allows you to execute a Cheetah template from the command line and collect the output. It can prepend the shell ENVIRONMENT or a pickled Python dictionary to the template's $placeholder searchList, overriding the defaults for the $placeholders. R R(RR(R ((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/TemplateCmdLineIface.pyRLs( RRt__doc__RtpathtbasenameRtargvR RRR(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/TemplateCmdLineIface.pyRs   ((R't __author__t __revision__RRRtos.pathtcPickleRt ImportErrortpickletCheetah.VersionRt ExceptionRR(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/TemplateCmdLineIface.pyt s