Commit 7a152191 authored by Aurel's avatar Aurel

fix encoding of path at export


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4729 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 77859fae
...@@ -192,7 +192,7 @@ class BusinessTemplateTarball(BusinessTemplateArchive): ...@@ -192,7 +192,7 @@ class BusinessTemplateTarball(BusinessTemplateArchive):
self.tar = tarfile.open('', 'w:gz', self.fobj) self.tar = tarfile.open('', 'w:gz', self.fobj)
def addFolder(self, name=''): def addFolder(self, name=''):
if not os.path.exists(name): if not os.path.exists(name):
os.makedirs(name) os.makedirs(name)
def addObject(self, obj, name, path=None, ext='.xml'): def addObject(self, obj, name, path=None, ext='.xml'):
...@@ -338,7 +338,13 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -338,7 +338,13 @@ class ObjectTemplateItem(BaseTemplateItem):
obj = self._objects[key] obj = self._objects[key]
# create folder and subfolders # create folder and subfolders
folders, id = os.path.split(key) folders, id = os.path.split(key)
path = os.path.join(root_path, folders) encode_folders = []
for folder in folders.split('/'):
if '%' not in folder:
encode_folders.append(pathname2url(folder))
else:
encode_folders.append(folder)
path = os.path.join(root_path, (os.sep).join(encode_folders))
bta.addFolder(name=path) bta.addFolder(name=path)
# export object in xml # export object in xml
f=StringIO() f=StringIO()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment