$.Vf6ddlZddlZdZdZdZdedefdZy)Ncptj|r/t|jdd}|jd|dStj |r/t|jdd}|jd|dS|j jd|j jS)zv Returns a fully-qualified name for the specified object, such as 'landscape.lib.format.format_object()'.  .z())inspectismethodreprsplit __module__ isfunction __class____name__)objectnames 6/usr/lib/python3/dist-packages/landscape/lib/format.py format_objectrs  F|!!#&q)##$AdV2..   F #F|!!#&q)##$AdV2..)) *!F,<,<,E,E+F GGc(|sd}t|ddS)N.02fsfloat)secondss r format_deltar GnT "! $$rc(|sd}t|ddS)Nrr%r)percents rformat_percentr!rrpatternreturnc tjdtj}|jDcic]\}}|t |c}}fd}tj |||Scc}}w)aExpand the pattern by replacing the params with values in `kwargs`. This implements a small subset of shell parameter expansion and the patterns can only be in the following forms: - ${parameter} - ${parameter:offset} - start at `offset` to the end - ${parameter:offset:length} - start at `offset` to `offset + length` For simplicity, `offset` and `length` MUST be positive values. z8\$\{([a-zA-Z][a-zA-Z0-9]*)(?::([0-9]+))?(?::([0-9]+))?\}c|jd}|j}|jd|jd}}|r"t|}d}|r|t|z}|||S|S)Nrr)grouplowerint)matchparamresultoffsetlengthstartendvaluess r_replacezexpandvars.._replace3sm A &QQ KECc&k)%$ $ r)recompile MULTILINEitemsstrsub)r"kwargsregexkvr2r1s @r expandvarsr=#s` JJC  E%+LLN 3DAqaQi 3F  66%7 ++!4sA/)rr3rrr!r7r=rrr?s. H$% % ,,#,r