From 37f83d0a4131390a566565a49184223c8f2ac878 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 14 Nov 2017 12:40:36 -0200 Subject: [PATCH] =?UTF-8?q?Registra=20extens=C3=B5es=20desconhecidas=20p?= =?UTF-8?q?=20inspe=C3=A7=C3=A3o=20posterior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/scripts/exporta_zope/exporta_zope.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index d8498266a..f6ebb5748 100755 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -49,12 +49,20 @@ def br(obj): return obj +extensoes_desconhecidas = defaultdict(list) + + def dump_file(doc, path): name = doc['__name__'] - extension = EXTENSOES[doc['content_type']] + content_type = doc['content_type'] + extension = EXTENSOES.get(content_type, 'ZZZZ') + fullname = os.path.join(path, name + extension) print(fullname) + if extension == 'ZZZZ': + extensoes_desconhecidas[content_type].append(fullname) + # A partir daqui usamos dict.pop('...') nos __Broken_state__ # para contornar um "vazamento" de memória que ocorre # ao percorrer a árvore de objetos