From 0794e6d0de4e9eef3da079f58aff735157e75f54 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 3 Jul 2018 15:41:03 -0300 Subject: [PATCH] =?UTF-8?q?Corrige=20caminhos=20XSLT=20p=20conte=C3=BAdos?= =?UTF-8?q?=20do=20SDE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/scripts/exporta_zope/exporta_zope.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index bf71d051c..f24bdfea5 100755 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -395,13 +395,18 @@ def ajusta_extensao(fullname, conteudo): base, extensao = os.path.splitext(fullname) if extensao not in ['.xsl', '.xslt', '.yaml', '.css']: extensao = guess_extension(fullname, conteudo) - return base + extensao + return base + extensao, extensao def build_salvar(repo): def salvar(fullname, conteudo): - fullname = ajusta_extensao(fullname, conteudo) + fullname, extensao = ajusta_extensao(fullname, conteudo) + + # ajusta caminhos XSLT p conteúdos relacionados ao SDE + if extensao in ['.xsl', '.xslt', '.xml']: + conteudo = conteudo.replace('"XSLT/HTML', '"/XSLT/HTML') + if exists(fullname): # destrava arquivo pré-existente (o conteúdo mudou) repo_execute(repo, 'git annex unlock', fullname)