No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

loader.py 868B

12345678910111213141516171819202122232425262728293031323334
  1. import instance_settings
  2. import importlib
  3. import sys
  4. import os
  5. sys.path.append(instance_settings.lodel2_lib_path)
  6. from Lodel.settings import Settings
  7. # Settings initialisation
  8. Settings.load_module(instance_settings)
  9. globals()['Settings'] = Settings
  10. # Import dynamic code
  11. if os.path.isfile(Settings.dynamic_code_file):
  12. from dynleapi import *
  13. # Import wanted datasource objects
  14. for db_modname in ['leapidatasource', 'migrationhandler']:
  15. mod = importlib.import_module("DataSource.{pkg_name}.{mod_name}".format(
  16. pkg_name=Settings.get('ds_package'),
  17. mod_name=db_modname,
  18. )
  19. )
  20. # Expose the module in globals
  21. globals()[db_modname] = mod
  22. if __name__ == '__main__':
  23. import code
  24. print("""
  25. Running interactive python in Lodel2 %s instance environment
  26. """%Settings.sitename)
  27. code.interact(local=locals())