В модуле логгирования права на создаваемый файл изменены на 600

В модуле профилей исправлена ошибка вычитания значения переменных в функции профиля sum() 

git-svn-id: http://svn.calculate.ru/calculate2/calculate-lib/trunk@851 c91db197-33c1-4113-bf15-f8a5c547ca64
develop
asamoukin 15 years ago
parent 03b8cdcc84
commit a9df6371ed

@ -30,7 +30,7 @@ class log():
"""Добавляет текст в лог файл"""
if not os.path.exists(self.logFile):
try:
fd = os.open(self.logFile, os.O_CREAT)
fd = os.open(self.logFile, os.O_CREAT,0600)
os.close(fd)
except:
print "Error creating file %s"%self.logFile

@ -1958,7 +1958,7 @@ class utfBin:
def _intToChar(self, x):
he = hex(x)[-2:]
he = hex(x)[2:]
exec("ret = '\\x%s'" %he)
return ret
@ -2166,6 +2166,10 @@ class profile(_file, _terms):
try:
num = int(strNum)
except:
minus = False
if strNum[:1] == "-":
minus = True
strNum = strNum[1:]
if localVars.has_key(strNum):
num = localVars[strNum]
elif self.objVar.exists(strNum):
@ -2180,7 +2184,10 @@ class profile(_file, _terms):
print _("error local var %s not defined")\
%str(strNum)
exit(1)
strNumers.append(num)
if minus:
strNumers.append(-num)
else:
strNumers.append(num)
return sum(strNumers)
print _("error in profile %s")%nameProfile
print _("error profile term %s, incorrect data")%str(term)

Loading…
Cancel
Save