Mercurial > hg > drupalISMI
comparison importFromOpenMind/importer/check_ismi_transaction_log.py @ 53:1f160e595167
add log timestamp to csv file of lost nodes.
author | casties |
---|---|
date | Mon, 03 Apr 2017 17:54:36 +0200 |
parents | 1be17309db79 |
children |
comparison
equal
deleted
inserted
replaced
52:763b5d29fa5e | 53:1f160e595167 |
---|---|
33 | 33 |
34 s = "%s%s[%s]"%(nt, att, node) | 34 s = "%s%s[%s]"%(nt, att, node) |
35 return s | 35 return s |
36 | 36 |
37 | 37 |
38 nodeCsvFieldList = ['node_type', 'id', 'row_id', 'object_class', 'user', 'public', 'type', | 38 nodeCsvFieldList = ['_logtime', 'node_type', 'id', 'row_id', 'object_class', 'user', 'public', 'type', |
39 'version', 'modification_time', 'system_status', 'content_type', | 39 'version', 'modification_time', 'system_status', 'content_type', |
40 'source_id', 'source_modif', 'source_obj_class', 'target_id', 'target_modif', 'target_obj_class', | 40 'source_id', 'source_modif', 'source_obj_class', 'target_id', 'target_modif', 'target_obj_class', |
41 'own_value_b64'] | 41 'own_value_b64'] |
42 | 42 |
43 nodeCsvFieldMap = {'node_type':'node-type', 'id':'id', 'row_id':'row-id', 'object_class':'object-class', 'user':'user', | 43 nodeCsvFieldMap = {'_logtime':'_logtime', 'node_type':'node-type', 'id':'id', 'row_id':'row-id', 'object_class':'object-class', 'user':'user', |
44 'public':'public', 'type':'type', | 44 'public':'public', 'type':'type', |
45 'version':'version', 'modification_time':'mtime', 'system_status':'system-status', 'content_type':'content-type', | 45 'version':'version', 'modification_time':'mtime', 'system_status':'system-status', 'content_type':'content-type', |
46 'source_id':'source-id', 'source_modif':'source-mtime', 'source_obj_class':'source-oc', | 46 'source_id':'source-id', 'source_modif':'source-mtime', 'source_obj_class':'source-oc', |
47 'target_id':'target-id', 'target_modif':'target-mtime', 'target_obj_class':'target-oc', | 47 'target_id':'target-id', 'target_modif':'target-mtime', 'target_obj_class':'target-oc', |
48 'own_value_b64':'b64-value'} | 48 'own_value_b64':'b64-value'} |
415 data = parseSave(line) | 415 data = parseSave(line) |
416 if data is None: | 416 if data is None: |
417 log("DEBUG", "Error parsing line: %s"%line) | 417 log("DEBUG", "Error parsing line: %s"%line) |
418 continue | 418 continue |
419 | 419 |
420 # add log time | |
421 data['_logtime'] = td['time'] | |
422 | |
420 if omitDeleted and deleting > 0 and savingPrev > 0: | 423 if omitDeleted and deleting > 0 and savingPrev > 0: |
421 # this should be a save prev from deleting | 424 # this should be a save prev from deleting |
422 delId = deleteCtx['id'] | 425 delId = deleteCtx['id'] |
423 # check if node is related to deleted id | 426 # check if node is related to deleted id |
424 if data.get('id', None) == delId or data.get('source-id', None) == delId \ | 427 if data.get('id', None) == delId or data.get('source-id', None) == delId \ |
448 data = parseSave(line) | 451 data = parseSave(line) |
449 if data is None: | 452 if data is None: |
450 log("DEBUG", "Error parsing line: %s"%line) | 453 log("DEBUG", "Error parsing line: %s"%line) |
451 continue | 454 continue |
452 | 455 |
456 # add log time | |
457 data['_logtime'] = td['time'] | |
458 | |
453 if tid in saves: | 459 if tid in saves: |
454 saves[tid].append(data) | 460 saves[tid].append(data) |
455 | 461 |
456 else: | 462 else: |
457 saves[tid] = [data] | 463 saves[tid] = [data] |