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.

main.py 830B

12345678910111213141516171819202122232425262728
  1. #-*- coding: utf-8 -*-
  2. import os, os.path
  3. from lodel.plugin import LodelHook
  4. from lodel.settings import Settings
  5. PLUGIN_PATH = os.path.dirname(__file__)
  6. ##@brief Return the root url of the instance
  7. #@warning no trailing slash
  8. def root_url():
  9. return Settings.sitename
  10. ##@brief uwsgi startup demo
  11. @LodelHook('lodel2_loader_main')
  12. def uwsgi_fork(hook_name, caller, payload):
  13. if Settings.webui.standalone:
  14. cmd='{uwsgi} --http-socket {addr}:{port} --module plugins.webui.run'
  15. cmd = cmd.format(
  16. addr = Settings.webui.listen_address,
  17. port = Settings.webui.listen_port,
  18. uwsgi= Settings.webui.uwsgicmd)
  19. if Settings.webui.virtualenv is not None:
  20. cmd += " --virtualenv %s" % Settings.webui.virtualenv
  21. exit(os.system(cmd))