Bez popisu
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 697B

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