Ñò ‚Ic@sddkZddkZddkZeid'joddklZn ddkZddkZddkZddk Z da yddk Z Wn#e j oddklZ nXddkZdefd„ƒYZdeeeeedd „Zd „Zdad „Zd Zd „Zd„Zdedd„Zd„Zd„Zd„Zd„Zdd„Z ed„Z!d„Z"h dd6ed6ed6dd6e d6e#d6e$d6e%d 6ed6e!d!6Z&d"e'fd#„ƒYZ(d$„Z)d%ei*fd&„ƒYZ+dS((iÿÿÿÿNii(tstring24(t subprocess24t SkipTemplatecBseZdZRS(s‹ Raised to indicate that the template should not be copied over. Raise this exception during the substitution of your template (t__name__t __module__t__doc__(((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyRsic Csç|iddƒ|iddƒt|tƒ} | oti|d|dƒ} nti|ƒ} | iƒd|d}tii |ƒpK|djod ||fGHn|p t |d | d |d |ƒqùn!|djod ||fGHnxç| D]ß}| odi |d|gƒ}ntii ||ƒ}t |ƒ}|o2|djo||h|d6}|GHqqn|o"tii |t ||ƒƒ}nt}|idƒo|d }|}n| oŒti|d|ƒou|od|tii|ƒfGHnt|d|f||||d|dd|d|d|d | d| ƒqnÍ| o~tii|ƒok|od|tii|ƒfGHnt|||||d|dd|d|d|d | d| ƒqnG| oti|d|ƒ}n&t|dƒ}|iƒ}|iƒ|oVy%t||d|d|d| ƒ}Wntj o qnX|d%joqq“ntii |ƒ}|o“t|dƒ}|iƒ}|iƒ||jo!|od||fGHqqn|o't||||d|ƒpqq;q?| pqq?n|o| od|||fGHn*|o"d|tii|ƒ|fGHn|p*t|dƒ}|i|ƒ|iƒn| oó| oëtii tii tiitii|ƒƒdƒƒp|djo d|GHq³qßdd |g}|djod!|di |ƒfGHn|pPti |d"ti!ƒ}|i"ƒ\}}|djo|od#GH|GHq³qßq| o!|o|djo d$|GHqqWd%S(&s– Copies the ``source`` directory to the ``dest`` directory. ``vars``: A dictionary of variables to use in any substitutions. ``verbosity``: Higher numbers will show more about what is happening. ``simulate``: If true, then don't actually *do* anything. ``indent``: Indent any messages by this amount. ``sub_vars``: If true, variables in ``_tmpl`` files and ``+var+`` in filenames will be substituted. ``use_cheetah``: If true, then any templates encountered will be substituted with Cheetah. Otherwise ``template_renderer`` or ``string.Template`` will be used for templates. ``svn_add``: If true, any files written out in directories with ``.svn/`` directories will be added (via ``svn add``). ``overwrite``: If false, then don't every overwrite anything. ``interactive``: If you are overwriting a file and interactive is true, then ask before overwriting. ``template_renderer``: This is a function for rendering templates (if you don't want to use Cheetah or string.Template). It should have the signature ``template_renderer(content_as_string, vars_as_dict, filename=filename)``. tdott.tplust+iit is%sCreating %s/tsvn_addt verbositytpads%sDirectory %s existst/tfilenamet_tmpliûÿÿÿs%sRecursing into %stindentt use_cheetahtsub_varst interactivettemplate_renderertrbs"%s%s already exists (same content)tsimulates%sCopying %s to %stwbs.svns'%s.svn/ does not exist; cannot add filetsvntadds %sRunning: %ststdoutsScript output:s)%sFile already exists (not doing svn add)N(#t setdefaultt isinstancettuplet pkg_resourcestresource_listdirtostlistdirtsorttpathtexistst svn_makedirstjointshould_skip_filetsubstitute_filenametFalsetendswithtresource_isdirtbasenametcopy_dirtisdirtresource_stringtopentreadtclosetsubstitute_contentRtNonetquery_interactivetwritetdirnametabspatht subprocesstPopentPIPEt communicate(tsourcetdesttvarsR RRRRRR t overwriteRtuse_pkg_resourcestnamesR tnametfulltreasont dest_fulltsub_filetcontenttftalready_existst old_contenttcmdtprocRtstderr((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyR.sÌ$      "                 " :  cCsz|idƒodS|idƒp|idƒodS|idƒodS|idƒod S|d jod SdS(s Checks if a file should be skipped based on its name. If it should be skipped, returns the reason, otherwise returns None. Rs!Skipping hidden file %(filename)st~s.baks!Skipping backup file %(filename)ss.pycsSkipping .pyc file %(filename)ss $py.classs$Skipping $py.class file %(filename)stCVSt_darcss/Skipping version control directory %(filename)s(RQRRN(t startswithR+R5(RD((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyR(©s  c Csddkl}l}t||iƒ|iƒ||ƒƒ}t||iƒ|iƒ||ƒƒ}tg} |D]2} | idƒo| idƒ o | | qrqr~ ƒ} tg} |D]2} | idƒo| idƒ o | | q¾q¾~ ƒ} | | jod| | }n&| | jod| | }nd }d t|ƒt|ƒ| t|iƒƒ|fGHd |}x™tdjot |ƒi ƒi ƒ}nt}| p|d d jo„ddk }|d}d }x6t ii|ƒo"|d7}|dt|ƒ}qäWd||fGH|p|i||ƒntS|idƒoG|di ƒ}| p|d djo tGHq}n|d }an|d djotS|d djotS|djodi|ƒGHq}|d djodi|ƒGHq}tGHq}dS(Niÿÿÿÿ(t unified_difft context_diffR s+++t-s---s; %i lines addeds; %i lines removedts6Replace %i bytes with %i bytes (%i/%i lines changed%s)sOverwrite %s [y/n/d/B/?] itbs.bakisBacking up %s to %ssall itytntdcs td(RYRZRX(tdifflibRTRUtlistt splitlinestlenRSt all_answerR5t raw_inputtstriptlowertshutilR!R$R%tstrtcopyfiletTruet query_usageR*R'(tsrc_fntdest_fnt src_contentt dest_contentRRTRUtu_difftc_difft_[1]tltaddedt_[2]tremovedtmsgtprompttresponseRet new_dest_fnRZtrest((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyR6¿sj    $($(        sJResponses: Y(es): Overwrite the file with the new content. N(o): Do not overwrite the file. D(iff): Show a unified diff of the proposed changes (dc=context diff) B(ackup): Save the current file contents to a .bak file (and overwrite) Type "all Y/N/B" to use Y/N/B for answer to all future questions c Cs*tiitii|ƒƒ}tii|ƒpt||||ƒnti|ƒ|pdStiitii|dƒƒp|djo d|GHndSdd|g}|djod|di|ƒfGHnti |dti ƒ}|i ƒ\}}|djo|od GH|GHndS( Ns.svnis,%s.svn/ does not exist; cannot add directoryRRs %sRunning: %sR RsScript output:( R!R$R8R9R%R&tmkdirR'R:R;R<R=( tdirR R R tparentRMRNRRO((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyR&s$ "   cCs=x6|iƒD](\}}|id|t|ƒƒ}q W|S(Ns+%s+(titemstreplaceRf(tfnR@tvartvalue((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyR)s  sc Csåtiƒ}|i|ƒ|}|dj o|||d|ƒS|pSt|ƒ}y|it|ƒƒSWqštj o}t|d|ƒ‚qšXnt djoddk a nt i i d|d|gƒ}t |||ƒS(NRs in file %siÿÿÿÿR>t searchList( t standard_varstcopytupdateR5t LaxTemplatet substitutet TypeMappert Exceptiont _add_excepttCheetahtCheetah.TemplatetTemplatet careful_sub(RIR@RRRtvttmplte((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyR4s"       c Cs‘t|dƒpt||t|ƒS|i}ti|ƒ\}}}}h}x-|D]%} | |jo|| || \$) | # Escape sequence of two delimiters (?P[_a-z][_a-z0-9]*) | # delimiter and a Python identifier {(?P.*?)} | # delimiter and a braced identifier (?P) # Other ill-formed delimiter exprs ) (RRtpattern(((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyR†¥s (ii(,R!Rtsyst version_infotpaste.script.utilRtstringR¡R¥treR5R‹R:t ImportErrorRR•R‰RR*RhR.R(RaR6RiR&R)R4RŽR”R¤R§R«R­RŠR²RfR³RƒR·RˆR¶RR†(((s8/usr/lib/python2.6/site-packages/paste/script/copydir.pyts^           C