allow filename with \

This commit is contained in:
2020-11-18 22:18:16 +01:00
parent 3ad1bf0604
commit 7db3e2c2a9
11 changed files with 67 additions and 5 deletions

View File

@ -10,7 +10,7 @@ import logging
from typing import Dict, Any
from subprocess import call
from os import listdir, makedirs
from os.path import dirname, join, isfile
from os.path import dirname, join, isfile, abspath, normpath
from Cheetah.Template import Template as ChtTemplate
from Cheetah.NameMapper import NotFound as CheetahNotFound
@ -92,6 +92,21 @@ class CheetahTemplate(ChtTemplate):
file=filename,
searchList=[context, eosfunc, extra_context])
# FORK of Cheetah fonction, do not replace '\\' by '/'
def serverSidePath(self, path=None,
normpath=normpath,
abspath=abspath
):
if path:
return normpath(abspath(path))
# return normpath(abspath(path.replace("\\", '/')))
elif hasattr(self, '_filePath') and self._filePath:
return normpath(abspath(self._filePath))
else:
return None
class CreoleLeader:
def __init__(self, value, follower=None, index=None):