x[h7\ddlZddlZddlmZddlZdZdZGddejZy)N)StringIOz[a-zA-Z_]+[a-zA-Z0-9_]*ctjdtztjdtjdfD]}|j|syy)Nz\$z\$[0-9#\?\-@\*]z\$\{.+\}TF)recompileSHELL_VAR_RULEsearch)textrs D/usr/lib/python3/dist-packages/cloudinit/distros/parsers/sys_conf.py_contains_shell_variabler sV 5>)* %& ;   88D>  c*eZdZdZdZdZddZdZy)SysConfaA configobj.ConfigObj subclass specialised for sysconfig files. :param contents: The sysconfig file to parse, in a format accepted by ``configobj.ConfigObj.__init__`` (i.e. "a filename, file like object, or list of lines"). cJtjj||ddy)NFT) interpolationwrite_empty_values) configobj ConfigObj__init__)selfcontentss r rzSysConf.__init__3s$$$ (%D % r c|j}t}t|ttfr0|jdj ||jS|jt ||jS)N )writer isinstancelisttuplejoinstrgetvalue)rr out_contentss r __str__zSysConf.__str__8sm::<z hu .   tyy2 3$$&&   s8} -$$&&r ct|tstd|z|syd}|ddvr|ddvrt|dk(rfd}n|j j dr |j j d rnStjd |r=t|r"tjd |rfd }nfd }ntj}|s|S||S)NzValue "%s" is not a stringr)"'c,j||zSN_get_single_quotexrs r z SysConf._quote..Jsd44Q7!;r z$()z [\t\r\n ]z[\n\"']c,j||zSr*)_get_triple_quoter-s r r/z SysConf._quote..X$*@*@*Ca*Gr c,j||zSr*r+r-s r r/z SysConf._quote..\r3r ) rr ValueErrorlenstrip startswithendswithrrr shlexquote)rvalue multiline quot_funcs` r _quotezSysConf._quoteAs%%9UCD D 8z !eBi:&=5zQ; {{}''-%++-2H2H2M99\51/699Z7 G& !H&%*KK Lr c|j|j|}|j|j|}|j|}||d||S)N=)_decode_elementr?)r indent_stringentry this_entrycommentvalkeycmnts r _write_linezSysConf._write_lineds_""4;;z#:;""4;;u#56##G,        r N)F)__name__ __module__ __qualname____doc__rr"r?rJr r rr*s '! F  r r) rr:iorrrr rrrOr r rQs5  ,  F i!!F r