Переглянути джерело

Adding some comments in multisite loader.py & run.py

Yann Weber 7 роки тому
джерело
коміт
b7197d8ea4
2 змінених файлів з 16 додано та 1 видалено
  1. 6
    1
      lodel/plugins/multisite/loader.py
  2. 10
    0
      lodel/plugins/multisite/run.py

+ 6
- 1
lodel/plugins/multisite/loader.py Переглянути файл

@@ -4,6 +4,11 @@ import sys
4 4
 import shlex
5 5
 import warnings
6 6
 
7
+#Here we have to bootstrap a minimal __loader__ context in order
8
+#to be able to load the settings
9
+#
10
+#This file (once bootstraped) start a new process for uWSGI. uWSGI then
11
+#run lodel.plugins.multisite.run.application function
7 12
 try:
8 13
     from lodel.context import LodelContext
9 14
 except ImportError:
@@ -25,10 +30,10 @@ LodelContext.expose_modules(globals(), {
25 30
 if not settings.started():
26 31
     settings('./conf.d', multisite_confspecs.LODEL2_CONFSPECS)
27 32
 
28
-##@brief Starts uwsgi in background using options from confs
29 33
 LodelContext.expose_modules(globals(), {
30 34
     'lodel.settings': ['Settings']})
31 35
 
36
+##@brief Starts uwsgi in background using settings
32 37
 def uwsgi_fork():
33 38
     
34 39
     sockfile = os.path.join(buildconf.LODEL2VARDIR, 'uwsgi_sockets/')

+ 10
- 0
lodel/plugins/multisite/run.py Переглянути файл

@@ -3,6 +3,11 @@ import os
3 3
 import os.path
4 4
 import warnings
5 5
 
6
+#This file expose common function to process a wsgi request and the
7
+#uWSGI application callback
8
+
9
+
10
+#preloading all instances
6 11
 FAST_APP_EXPOSAL_CACHE = dict()
7 12
 
8 13
 LODEL2_INSTANCES_DIR = '.'
@@ -74,6 +79,11 @@ for lodelsite_path in lodelsites_list:
74 79
     #switch back to loader context
75 80
     LodelContext.set(None)
76 81
 
82
+#
83
+# From here lodel2 multisite instances are loaded and ready to run
84
+#
85
+
86
+
77 87
 ##@brief Utility function to return quickly an error
78 88
 def http_error(env, start_response, status = '500 internal server error', \
79 89
         extra = None):

Loading…
Відмінити
Зберегти