Skip to content

Commit

Permalink
Update code generate when importing. Refs #490
Browse files Browse the repository at this point in the history
  • Loading branch information
koenedaele committed May 22, 2020
1 parent 440fbdc commit a61d52f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions atramhasis/scripts/import_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,16 @@ def main(argv=sys.argv):
conceptscheme.id
print("\n\n*** The import of the {0} file with conceptscheme label '{1}' to {2} was succesfull. ***\
\n\nTo use the data in Atramhasis, you must edit the file my_thesaurus/skos/__init__.py.\
\nAdd next lines: \
\n\ndef includeme(config):\
\n\t{3} = SQLAlchemyProvider(\
\n\t\t{{'id': '{4}', 'conceptscheme_id': {5}}},\
\n\t\tconfig.registry.dbmaker\
\n\t)\
\n\tskosregis = config.get_skos_registry()\
\n\tskosregis.register_provider({6})\n\n".
\nAdd a configuration similar to:\
\n\ndef create_registry(request):\
\n\t# create the SKOS registry\
\n\tregistry = Registry(instance_scope='threaded_thread')\
\n\t{3} = SQLAlchemyProvider(\
\n\t\t{{'id': '{4}', 'conceptscheme_id': {5}}},\
\n\t\trequest.db\
\n\t)\
\n\tregistry.register_provider({6})\
\n\treturn registry\
\n\n".
format(args.input_file, cs_label, args.to,
prov_id.replace(' ', '_'), prov_id, scheme_id, prov_id.replace(' ', '_')))

0 comments on commit a61d52f

Please sign in to comment.