|
|
|
@ -3436,7 +3436,6 @@ re.M|re.S)
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
applyDir = newDir
|
|
|
|
|
# Родительская директория
|
|
|
|
|
if optDir.get("path"):
|
|
|
|
@ -3450,6 +3449,9 @@ re.M|re.S)
|
|
|
|
|
realPath = os.path.join("/",applyDir.partition(self._baseDir)[2])
|
|
|
|
|
if realPath in self.dirsFilter:
|
|
|
|
|
return (applyDir, False)
|
|
|
|
|
# Создаем директорию если необходимо
|
|
|
|
|
if not self.createDir(applyDir, False, self.uid, self.gid):
|
|
|
|
|
return False
|
|
|
|
|
return (applyDir, True)
|
|
|
|
|
try:
|
|
|
|
|
FD = open(templateDirFile)
|
|
|
|
@ -3525,7 +3527,6 @@ re.M|re.S)
|
|
|
|
|
self.setError(_("False value 'chmod' in template") + ": " +\
|
|
|
|
|
templateDirFile)
|
|
|
|
|
return (applyDir, False)
|
|
|
|
|
|
|
|
|
|
# chown - изменяем владельца и группу
|
|
|
|
|
if "chown" in objHead.params:
|
|
|
|
|
owner = objHead.params['chown']
|
|
|
|
@ -4258,11 +4259,16 @@ class iniParser(_error, templateFormat):
|
|
|
|
|
self.setError(_("Unable to create file") + ": " + self.iniFile)
|
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|
FD = open(self.iniFile, "r+")
|
|
|
|
|
try:
|
|
|
|
|
FD = open(self.iniFile, "r+")
|
|
|
|
|
except:
|
|
|
|
|
self.setError(_("Unable to open file") + ": " + self.iniFile)
|
|
|
|
|
return False
|
|
|
|
|
FD.truncate(0)
|
|
|
|
|
FD.seek(0)
|
|
|
|
|
FD.write(txtConfig)
|
|
|
|
|
FD.close()
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def setVar(self, strHeader, dictVar):
|
|
|
|
|
"""Заменяет или добавляет область и переменные
|
|
|
|
@ -4299,7 +4305,8 @@ class iniParser(_error, templateFormat):
|
|
|
|
|
# получаем текст
|
|
|
|
|
txtConfig = objIni.getConfig().encode("UTF-8")
|
|
|
|
|
# записываем его в ini файл
|
|
|
|
|
self.writeIniFile(txtConfig)
|
|
|
|
|
if not self.writeIniFile(txtConfig):
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def isEmptyFile(self, textIni):
|
|
|
|
|