diff --git a/pym/calculate/lib/cl_template.py b/pym/calculate/lib/cl_template.py index 28a6fc6..b55f7da 100644 --- a/pym/calculate/lib/cl_template.py +++ b/pym/calculate/lib/cl_template.py @@ -5350,7 +5350,6 @@ gettext -d cl_template "$*" if HParams.DirectoryLink in objHead.params: templateFile = objHead.params[HParams.DirectoryLink] templateFile = pathJoin(self._baseDir, templateFile) - #TODO relative path for dirs? if not os.path.isdir(templateFile): self.setError(_("Source path %s is not a directory") % templateFile) @@ -5707,13 +5706,14 @@ gettext -d cl_template "$*" # Получаем директорию пользователя templateFile = os.path.join( self.homeDir, templateFile.partition("/")[2], "")[:-1] - if templateFile and templateFile[0] == "/": - templateFile = pathJoin(self._baseDir, templateFile) - else: - #relative path - templateFile = pathJoin(os.path.dirname(pathOldFile), templateFile) - templateFile = pathJoin(self._baseDir, templateFile) - templateFile = os.path.abspath(templateFile) + templateFile = pathJoin(self._baseDir, templateFile) + # if templateFile and templateFile[0] == "/": + # templateFile = pathJoin(self._baseDir, templateFile) + # else: + # #relative path + # templateFile = pathJoin(os.path.dirname(pathOldFile), templateFile) + # templateFile = pathJoin(self._baseDir, templateFile) + # templateFile = os.path.abspath(templateFile) if (not os.path.exists(templateFile) or not objHeadNew.params[HParams.Link]): if os.path.exists(pathOldFile): @@ -5737,14 +5737,14 @@ gettext -d cl_template "$*" # Получаем директорию пользователя templateFile = os.path.join( self.homeDir, templateFile.partition("/")[2], "")[:-1] - - if templateFile and templateFile[0] == "/": - templateFile = pathJoin(self._baseDir, templateFile) - else: - #relative path - templateFile = pathJoin(os.path.dirname(pathOldFile), templateFile) - templateFile = pathJoin(self._baseDir, templateFile) - templateFile = os.path.abspath(templateFile) + templateFile = pathJoin(self._baseDir, templateFile) + # if templateFile and templateFile[0] == "/": + # templateFile = pathJoin(self._baseDir, templateFile) + # else: + # # relative path + # templateFile = pathJoin(os.path.dirname(pathOldFile), templateFile) + # templateFile = pathJoin(self._baseDir, templateFile) + # templateFile = os.path.abspath(templateFile) foundTemplateFile = os.path.exists(templateFile) buff = None buff_is_unicode = False