From c7affe7e3c17a4e88fe7f22bba7299309729e0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Fri, 11 Mar 2011 14:18:35 +0300 Subject: [PATCH] Bugfix cl_name in root templates. --- pym/cl_template.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pym/cl_template.py b/pym/cl_template.py index c16cdb1..fb6b55a 100644 --- a/pym/cl_template.py +++ b/pym/cl_template.py @@ -3804,22 +3804,26 @@ re.M|re.S) else: flagDir = False templatePath = dirFile - if os.path.isfile(templatePath) and\ - self.getFileType(templatePath) != "bin": - textTemplate = open(templatePath).read() - if textTemplate: - headerLine = self.getHeaderText(textTemplate) - if headerLine: - if not "cl_name==" in headerLine: + if os.path.isfile(templatePath): + if self.getFileType(templatePath) == "bin": + skipTemplates.append(dirFile) + else: + textTemplate = open(templatePath).read() + if textTemplate: + headerLine = self.getHeaderText(textTemplate) + if headerLine: + if not "cl_name==" in headerLine: + if flagDir: + skipDirs.append(dirFile) + else: + skipTemplates.append(dirFile) + else: if flagDir: skipDirs.append(dirFile) else: skipTemplates.append(dirFile) else: - if flagDir: - skipDirs.append(dirFile) - else: - skipTemplates.append(dirFile) + skipTemplates.append(dirFile) if skipDirs or skipTemplates: # print warning from cl_print import color_print