&}ddlmZddlmZddlmZddlZddlmZddlm Z ddl m Z dZ d Z d d Zed kr edSdS) )ArgumentParser)dirname)isfileN) exceptions)TemplateLookup)Templatec>d|vr|dfS|ddS)N=)split)vars /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/mako/cmd.pyvarsplitrs) #~~Ry 99S!  ctjtjtjddS)Nr )sysstderrwritertext_error_templaterenderexitrr_exitrs>JZ355<<>>???HQKKKKKrc0t}|dgdd|dgdd|ddd |d dd |d d d||}|j}|j}|jdkr^|jpdg}t|} ttj ||}n#tYnzxYw|j}t|std|z|jpt|g}t|} t|||}n#tYnxYwt!d|jD} |jdi| } |r't'|d|| dStj| dS#tYdSxYw)Nz--varappendz5variable (can be used multiple times, use name=value))defaultactionhelpz--template-dirzDirectory to use for template lookup (multiple directories may be provided). If not given then if the template is read from stdin, the value defaults to be the current directory, otherwise it defaults to be the parent directory of the file provided.z--output-encodingzforce output encoding)rrz --output-filez6Write to file upon successful render instead of stdoutinput?-)nargsr.)lookupoutput_encodingzerror: can't find %s)filenamer%r&c34K|]}t|VdSN)r).0rs r zcmdline..Ws( 3 3hsmm 3 3 3 3 3 3rwt)encodingr)r add_argument parse_argsr& output_filer template_dirrrrstdinreadrr SystemExitrdictrropenrstdout) argvparseroptionsr&r0 lookup_dirsr%templater'kwrendereds rcmdliner?s   F  D   1     T0G  E  sC888%%G-O%K}*3se  ,,     /HH   GGGGG=h @3h>?? ?*Awx/@/@.A  ,, ! /HH   GGGGG 3 3w{ 3 3 3 3 3B'"8?((R((  ' d_ = = = C CH M M M M M J  X & & & & &  s$.DD$E77F + HH__main__r))argparseros.pathrrrmakor mako.lookupr mako.templaterrrr?__name__rrrrGs $##### &&&&&&""""""  E'E'E'E'P z GIIIIIr