|
@ -17,14 +17,14 @@ from functools import partial |
|
|
import git |
|
|
import git |
|
|
import magic |
|
|
import magic |
|
|
import yaml |
|
|
import yaml |
|
|
from unipath import Path |
|
|
|
|
|
|
|
|
|
|
|
import ZODB.DB |
|
|
import ZODB.DB |
|
|
import ZODB.FileStorage |
|
|
import ZODB.FileStorage |
|
|
from variaveis_comuns import DIR_DADOS_MIGRACAO, TAG_ZOPE |
|
|
from unipath import Path |
|
|
from ZODB.broken import Broken |
|
|
from ZODB.broken import Broken |
|
|
from ZODB.POSException import POSKeyError |
|
|
from ZODB.POSException import POSKeyError |
|
|
|
|
|
|
|
|
|
|
|
from variaveis_comuns import DIR_DADOS_MIGRACAO, TAG_ZOPE |
|
|
|
|
|
|
|
|
EXTENSOES = { |
|
|
EXTENSOES = { |
|
|
'application/msword': '.doc', |
|
|
'application/msword': '.doc', |
|
|
'application/pdf': '.pdf', |
|
|
'application/pdf': '.pdf', |
|
@ -291,8 +291,10 @@ def get_app(data_fs_path): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def find_sapl(app): |
|
|
def find_sapl(app): |
|
|
for obj in app['_objects']: |
|
|
ids_meta_types = [(obj['id'], obj['meta_type']) for obj in app['_objects']] |
|
|
id, meta_type = obj['id'], obj['meta_type'] |
|
|
# estar ordenado é muito importante para que a busca dê prioridade |
|
|
|
|
|
# a um id "cm_zzz" antes do id "sapl" |
|
|
|
|
|
for id, meta_type in sorted(ids_meta_types): |
|
|
if id.startswith('cm_') and meta_type == 'Folder': |
|
|
if id.startswith('cm_') and meta_type == 'Folder': |
|
|
cm_zzz = br(app[id]) |
|
|
cm_zzz = br(app[id]) |
|
|
return find_sapl(cm_zzz) |
|
|
return find_sapl(cm_zzz) |
|
|