From 8997c91dfcbf252127ece602c066d00e14e34203 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 19 Apr 2018 11:58:43 -0300 Subject: [PATCH] Ignora aquivos vazios ao exportar docs --- sapl/legacy/scripts/exporta_zope/exporta_zope.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index 2c687bc07..a22c49b87 100755 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -18,10 +18,9 @@ import git import magic import pyaml import yaml -from unipath import Path - import ZODB.DB import ZODB.FileStorage +from unipath import Path from ZODB.broken import Broken EXTENSOES = { @@ -107,7 +106,11 @@ def dump_file(doc, path, salvar): while pdata: output.write(pdata.pop('data')) pdata = br(pdata.pop('next', None)) - salvar(fullname, output.getvalue()) + + conteudo = output.getvalue() + if conteudo: + # pula arquivos vazios + salvar(fullname, conteudo) return name