Browse Source

Adiciona dump de propriedades do site

pull/1634/head
Marcio Mazza 7 years ago
parent
commit
80d20175e7
  1. 10
      sapl/legacy/scripts/exporta_zope/exporta_zope.py
  2. 1
      sapl/legacy/scripts/exporta_zope/requirements.txt

10
sapl/legacy/scripts/exporta_zope/exporta_zope.py

@ -152,3 +152,13 @@ def dump_sapl(data_fs_path):
print('#' * 80)
finally:
close_db()
def dump_propriedades(docs):
props_sapl = br(docs['props_sapl'])
ids = [p['id'] for p in props_sapl['_properties']]
props = {id: props_sapl[id] for id in ids}
props = {id: p.decode('iso-8859-1') if isinstance(p, str) else p
for id, p in props.items()}
with open('sapl_documentos/propriedades.yaml', 'w') as f:
f.write(yaml.safe_dump(props))

1
sapl/legacy/scripts/exporta_zope/requirements.txt

@ -1,2 +1,3 @@
# ZODB version 3.7.4
git+git://github.com/zopefoundation/ZODB.git@d6f3c3ce5e6df1060de7a3#egg=ZODB3
PyYAML==3.12

Loading…
Cancel
Save