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

12345678910111213141516171819202122232425262728
  1. import os
  2. import importlib
  3. from utils import dyn_code_filename
  4. from Lodel.settings import Settings
  5. # Import dynamic code
  6. if Settings.acl_bypass:
  7. from dyncode.internal_api import *
  8. else:
  9. from dyncode.acl_api import *
  10. # Import wanted datasource objects
  11. for db_modname in ['leapidatasource', 'migrationhandler']:
  12. mod = importlib.import_module("DataSource.{pkg_name}.{mod_name}".format(
  13. pkg_name=Settings.get('ds_package'),
  14. mod_name=db_modname,
  15. )
  16. )
  17. # Expose the module in globals
  18. globals()[db_modname] = mod
  19. if __name__ == '__main__':
  20. import code
  21. print("""
  22. Running interactive python in Lodel2 %s instance environment
  23. """%Settings.sitename)
  24. code.interact(local=locals())