From 7f8d692161d0bc8fe8615c919ae31a2bb0877fa0 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 18 Sep 2018 15:44:48 -0300 Subject: [PATCH] =?UTF-8?q?Estende=20exporta=C3=A7=C3=A3o=20de=20docs=20pa?= =?UTF-8?q?ra=20instala=C3=A7=C3=B5es=20de=20fora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/exporta_zope/exporta_zope.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index 8f3b1eb4a..529fb3d62 100755 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -381,18 +381,30 @@ def _dump_sapl(data_fs_path, documentos_fs_path, destino, salvar, mtimes): sapl = find_sapl(app) # extrai usuários com suas senhas e perfis dump_usuarios(sapl, destino, salvar) + + # extrai folhas XSLT (primeira tentativa) + if 'XSLT' in sapl: + dump_folder(br(sapl['XSLT']), destino, salvar, mtimes) + finally: close_db() app, close_db = get_app(documentos_fs_path) + try: sapl = find_sapl(app) - # extrai folhas XSLT - if 'XSLT' in sapl: - dump_folder(br(sapl['XSLT']), destino, salvar, mtimes) + if sapl == {'id': 'sapl'}: + # em algumas instalações sapl_documentos está direto na raiz + docs = br(app['sapl_documentos']) + else: + # caso mais comum + docs = br(sapl['sapl_documentos']) + + # extrai folhas XSLT (segunda tentativa) + if 'XSLT' in sapl: + dump_folder(br(sapl['XSLT']), destino, salvar, mtimes) # extrai documentos - docs = br(sapl['sapl_documentos']) with logando_nao_identificados(): dump_folder(docs, destino, salvar, mtimes) dump_propriedades(docs, destino, salvar)