changeset 59:adfb57978a69

use sys.exit(1) when something breaks.
author casties
date Wed, 16 Aug 2017 23:17:55 +0200
parents 4f833d8fc383
children 1b520696760a
files importFromOpenMind/importer/ismixml2model.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/importFromOpenMind/importer/ismixml2model.py	Tue Aug 01 19:10:46 2017 +0200
+++ b/importFromOpenMind/importer/ismixml2model.py	Wed Aug 16 23:17:55 2017 +0200
@@ -12,7 +12,8 @@
 
 
 # node types to exclude from the graph
-exclude_objects_of_type = ['DIGITALIZATION', 'REFERENCE']
+#exclude_objects_of_type = ['DIGITALIZATION', 'REFERENCE']
+exclude_objects_of_type = []
 
 # attributes to exclude
 exclude_attributes_of_type = [
@@ -303,8 +304,8 @@
         log('DEBUG', "reading entity[%s]"%ismi_id)
         
         if ismi_id in nx_nodes:
-            log("ERROR", "entity with id=%s exists!"%ismi_id)
-            return
+            log("ERROR", "entity with id=%s exists! Aborting."%ismi_id)
+            sys.exit(1)
         
         # create networkx node
         node = nodeFromEnt(ent_elem)
@@ -332,8 +333,8 @@
         log('DEBUG', "reading relation[%s]"%ismi_id)
         
         if ismi_id in nx_relations:
-            print("ERROR: relation with id=%s exists!"%ismi_id)
-            return
+            print("ERROR: relation with id=%s exists! Aborting."%ismi_id)
+            sys.exit(1)
         
         # create networkx relation
         relation = relationFromRel(rel_elem)