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

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. """ # useless ?
  16. # Import wanted datasource objects
  17. for db_modname in ['leapidatasource', 'migrationhandler']:
  18. mod = importlib.import_module("DataSource.{pkg_name}.{mod_name}".format(
  19. pkg_name=Settings.get('ds_package'),
  20. mod_name=db_modname,
  21. )
  22. )
  23. # Expose the module in globals
  24. globals()[db_modname] = mod
  25. """
  26. if __name__ == '__main__':
  27. import code
  28. print("""
  29. Running interactive python in Lodel2 %s instance environment
  30. """%Settings.sitename)
  31. code.interact(local=locals())