diff --git a/pym/cl_template.py b/pym/cl_template.py index 3fdb512..859f4b5 100644 --- a/pym/cl_template.py +++ b/pym/cl_template.py @@ -4847,11 +4847,20 @@ class iniParser(_error, templateFormat): return True def isEmptyFile(self, textIni): - """Является ли файл пустым""" - if not textIni.strip(): - return True + """Если файл пустой или содержит только комментарии - False + + иначе - True + """ + if textIni.strip(): + if filter(lambda x: x.strip(), + map(lambda x:x[0].split(";")[0], + map(lambda x: x.split("#"), + textIni.splitlines()))): + return False + else: + return True else: - return False + return True def checkIniFile(self, textIni): """Проверка на правильность формата файла""" diff --git a/pym/format/plasma.py b/pym/format/plasma.py index d21c1d7..d43aed3 100644 --- a/pym/format/plasma.py +++ b/pym/format/plasma.py @@ -203,6 +203,8 @@ class plasma(samba): blTmp = self.blocTextObj.findBloc(self.text,self.reHeader,self.reBody) blocs = self.getFullAreas(blTmp) + if blocs == []: + return [] reH = re.compile("\[([^\[\]]+)\]") # Список имен блоков namesBlockList = []