Browse Source

Added ini() option 'purl'

develop
Самоукин Алексей 11 years ago
parent
commit
0807d5efac
  1. 6
      pym/cl_template.py

6
pym/cl_template.py

@ -2968,7 +2968,7 @@ or 'lower' or 'capitalize'"))
valueLocVar = terms[1]
self.currDictIni[nameLocVar] = valueLocVar
elif len(terms) == 3:
if not terms[2] in ['url','unicode']:
if not terms[2] in ['url','purl','unicode']:
self.printErrTemplate()
cl_overriding.printERROR(_("third argument function is not "
"'url' or 'unicode'"))
@ -2984,10 +2984,12 @@ or 'lower' or 'capitalize'"))
self.timeIni = self.getTimeFile(self.fileConfigIni)
if nameLocVar in self.currDictIni.keys():
unicodeValue = self.currDictIni[nameLocVar]
if terms[2] == 'url':
if terms[2] in ('url', 'purl'):
replace = unicodeValue.encode("UTF-8").\
__repr__()[1:-1].replace('\\x','%').\
replace(' ','%20')
if terms[2] == 'purl':
replace = replace.replace('/','%2f')
elif terms[2] == 'unicode':
replace = unicodeValue.__repr__()[2:-1]
else:

Loading…
Cancel
Save