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 976B

1234567891011121314151617181920212223242526272829303132333435363738
  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. from Lodel import logger # logger import and initialisation
  11. from plugins import * #Load activated plugins
  12. # Import dynamic code
  13. if os.path.isfile(Settings.dynamic_code_file):
  14. from dynleapi import *
  15. # Import wanted datasource objects
  16. for db_modname in ['leapidatasource', 'migrationhandler']:
  17. mod = importlib.import_module("DataSource.{pkg_name}.{mod_name}".format(
  18. pkg_name=Settings.get('ds_package'),
  19. mod_name=db_modname,
  20. )
  21. )
  22. # Expose the module in globals
  23. globals()[db_modname] = mod
  24. if __name__ == '__main__':
  25. import code
  26. print("""
  27. Running interactive python in Lodel2 %s instance environment
  28. """%Settings.sitename)
  29. code.interact(local=locals())