From a54d056d1f1fa5c0bd7908a4f6b34de15deac5cc Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 16 Feb 2018 16:59:59 -0200 Subject: [PATCH] =?UTF-8?q?Melhora=20docs=20e=20ajusta=20exporta=C3=A7?= =?UTF-8?q?=C3=A3o=20do=20zope=20de=20sapl=203.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/scripts/exporta_zope/dump30.py | 33 ++++++++++++++-------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/sapl/legacy/scripts/exporta_zope/dump30.py b/sapl/legacy/scripts/exporta_zope/dump30.py index 3fca44cf5..40a9bfd4e 100644 --- a/sapl/legacy/scripts/exporta_zope/dump30.py +++ b/sapl/legacy/scripts/exporta_zope/dump30.py @@ -3,16 +3,25 @@ from exporta_zope import (br, dump_folder, dump_propriedades, dump_usuarios, def dump_sapl30(): - destino = '../../../../media' - data_fs_path = destino + '/Data.fs' - docs_path = destino + '/DocumentosSapl.fs' - app, close_db = get_app(data_fs_path) - sapl = br(app['sapl']) - dump_usuarios(sapl, destino) - close_db() + """Extrai dados do zope de um sapl 3.0, que, ao que tudo indica: + * não possui a pasta XSLT + * usa um mountpoint separado para os documentos + """ + try: + destino = '../../../../media' + data_fs_path = destino + '/Data.fs' + docs_path = destino + '/DocumentosSapl.fs' + app, close_db = get_app(data_fs_path) + sapl = br(app['sapl']) + dump_usuarios(sapl, destino) + finally: + close_db() - app, close_db = get_app(docs_path) - docs = br(app['sapl_documentos']) - with logando_nao_identificados(): - dump_folder(docs, destino) - dump_propriedades(docs, destino) + try: + app, close_db = get_app(docs_path) + docs = br(app['sapl_documentos']) + with logando_nao_identificados(): + dump_folder(docs, destino) + dump_propriedades(docs, destino) + finally: + close_db()