PK"YJ'QQcjrh_template.py""" Subclass for ``string.Template``, adds ``placeholders()`` method. """ import string __version__ = '2017.5.3' class Template(string.Template): """ Very thin subclass of ``string.Template``. """ def placeholders(self, allow_repeats=False): """ Return the names of the template variables in the template. Note that this returns a generator. The ``allow_repeats`` argument will cause the iteration to skip any repeated variable names. :type allow_repeats: bool :return: A generator of all the named vars :rtype: generator """ seen = set() for match in self.pattern.finditer(self.template): named = match.group('named') if not allow_repeats: if named in seen: continue else: # Structured like this so that we don't incur the memory # cost of storing previously-seen items when repeats are # allowed. seen.add(named) yield named PK!H|&Ub&cjrh_template-2017.5.3.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,Q034 /, (-JLR()*M ILR(4KM̫#DPK!HS_y)cjrh_template-2017.5.3.dist-info/METADATATmoF ~8 beI0 P`FҠS iajZGYIweO~,;V ;<"#&5Kl(K>35mLhp͏ٝycS.jL aJdϣjuhm. X4U7yI[1)8uVZ\O<|˷OK]6U~8̢l1X UtTY5>[a^kt$=daYG sTVj؎HmV\{bQNNJ$ !,SAM~$UtX׽ %Nb?tqf}6hG-y'>G3rk<' ڻGT 1d m?@'cՐVJe5Lu<;ÖdՕլX~ڑ&PK!Hۗ2'cjrh_template-2017.5.3.dist-info/RECORDn0лRC#ѠRQZ,n@3_n{y0}ڽh> _~ad(ԃz3B~GYHՑ=4CUhRw/"4}2õU s[5Z8,q qFspx PK"YJ'QQcjrh_template.pyPK!H|&Ub&cjrh_template-2017.5.3.dist-info/WHEELPK!HS_y)cjrh_template-2017.5.3.dist-info/METADATAPK!Hۗ2'cjrh_template-2017.5.3.dist-info/RECORDPK>