暫無描述
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 881B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #-*- coding: utf-8 -*-
  2. import sys, os
  3. #
  4. # Bootstraping
  5. #
  6. LODEL2_LIB_ABS_PATH = None
  7. if LODEL2_LIB_ABS_PATH is not None:
  8. sys.path.append(os.path.dirname(LODEL2_LIB_ABS_PATH))
  9. try:
  10. import lodel
  11. except ImportError:
  12. print("Unable to load lodel module. exiting...", file = sys.stderr)
  13. exit(1)
  14. #
  15. # Loading settings
  16. #
  17. from lodel.settings.settings import Settings as settings
  18. settings('conf.d')
  19. from lodel.settings import Settings
  20. #Load plugins
  21. from lodel.plugin import Plugins
  22. Plugins.bootstrap()
  23. from lodel.plugin import LodelHook
  24. LodelHook.call_hook('lodel2_bootstraped', '__main__', None)
  25. if __name__ == '__main__':
  26. LodelHook.call_hook('lodel2_loader_main', '__main__', None)
  27. #Run interative python
  28. import code
  29. print("""
  30. Running interactive python in Lodel2 %s instance environment
  31. """%Settings.sitename)
  32. code.interact(local=locals())