Fix work ini function with removed values.

develop
Mike Hiretsky 13 years ago
parent ec800e0180
commit a3b508528a

@ -3019,7 +3019,10 @@ or 'lower' or 'capitalize'"))
self.currDictIni.update(self.prevDictIni) self.currDictIni.update(self.prevDictIni)
self.timeIni = self.getTimeFile(self.fileConfigIni) self.timeIni = self.getTimeFile(self.fileConfigIni)
if nameLocVar in self.currDictIni.keys(): if nameLocVar in self.currDictIni.keys():
replace = self.currDictIni[nameLocVar].encode("UTF-8") if self.currDictIni[nameLocVar] is None:
replace = ""
else:
replace = self.currDictIni[nameLocVar].encode("UTF-8")
elif len(terms) == 2: elif len(terms) == 2:
if self.timeIni != curTime: if self.timeIni != curTime:
# читаем переменные из файла # читаем переменные из файла
@ -3047,6 +3050,8 @@ or 'lower' or 'capitalize'"))
self.timeIni = self.getTimeFile(self.fileConfigIni) self.timeIni = self.getTimeFile(self.fileConfigIni)
if nameLocVar in self.currDictIni.keys(): if nameLocVar in self.currDictIni.keys():
unicodeValue = self.currDictIni[nameLocVar] unicodeValue = self.currDictIni[nameLocVar]
if unicodeValue is None:
unicodeValue = ""
if terms[2] in ('url', 'purl'): if terms[2] in ('url', 'purl'):
replace = unicodeValue.encode("UTF-8").\ replace = unicodeValue.encode("UTF-8").\
__repr__()[1:-1].replace('\\x','%').\ __repr__()[1:-1].replace('\\x','%').\

Loading…
Cancel
Save