def main(argv): ifc_file = '' try: opts, args = getopt.getopt(argv, "h") except getopt.GetoptError: print('load_ifc.py <ifc_file>') sys.exit(2) if opts == ['-h'] or len(args) != 1: print('load_ifc.py <ifc_file>') sys.exit() ifc_file = args[0] db_accessor = DBAccessor() db_accessor.set_handler(init_handlers(url=ONTO_URL)) ifc_import = IfcImport(ifc_file, db_accessor=db_accessor) ifc_import.execute()
def db_accessor(): '''Creates a well-configured DBAccessor so as to store elements in the data model''' accessor = DBAccessor() accessor.set_handler(init_handlers()) return accessor
def init_app(app): """Initialize ontology manager""" base_url = app.config['ONTOLOGY_BASE_URL'] db_accessor.set_handler(init_handlers(base_url))