develop
asamoukin 15 years ago
parent dc52077257
commit 416e751295

@ -2375,9 +2375,9 @@ class profile(_file, _terms,xmlShare):
"""локальная функция выдает переменную в определенном регистре
первый аргумент:
'uc' - верхний регистр,
'lc' - нижний регистр,
'ucfirst' - первая буква в верхнем регистре
'upper' - верхний регистр,
'lower' - нижний регистр,
'capitalize' - первая буква в верхнем регистре
второй аргумент:
название переменной
"""
@ -2387,12 +2387,12 @@ class profile(_file, _terms,xmlShare):
print _("error in profile %s")%nameProfile
print _("error profile term %s")%str(funTxt)
exit(1)
fArgvNames = ['uc','lc','ucfirst']
fArgvNames = ['upper','lower','capitalize']
if not terms[0] in fArgvNames:
print _("error in profile %s")%nameProfile
print _("error profile term %s")%str(funTxt)
print _("first argument function is not 'uc' or 'lc' or\
'ucfirst'")
print _("first argument function is not 'upper' or 'lower' or\
'capitalize'")
exit(1)
try:
strValue = str(self.objVar.Get(terms[1]))
@ -2402,11 +2402,11 @@ class profile(_file, _terms,xmlShare):
exit(1)
replace = ""
strValue = self._toUNICODE(strValue)
if terms[0] == 'uc':
if terms[0] == 'upper':
replace = strValue.upper()
elif terms[0] == 'lc':
elif terms[0] == 'lower':
replace = strValue.lower()
elif terms[0] == 'ucfirst':
elif terms[0] == 'capitalize':
replace = strValue.capitalize()
if replace:
replace = replace.encode("UTF-8")

Loading…
Cancel
Save