Browse Source

Bugfix in webui plugin

Avoid useless impossible import by putting confpsec in a dedicated file
Yann Weber 8 years ago
parent
commit
ee06ccf1eb
3 changed files with 23 additions and 22 deletions
  1. 2
    1
      install/loader.py
  2. 1
    21
      plugins/webui/__init__.py
  3. 20
    0
      plugins/webui/confspec.py

+ 2
- 1
install/loader.py View File

@@ -19,7 +19,8 @@ except ImportError:
19 19
 # Loading settings
20 20
 #
21 21
 from lodel.settings.settings import Settings as settings
22
-settings('conf.d')
22
+if not settings.started():
23
+    settings('conf.d')
23 24
 from lodel.settings import Settings
24 25
 
25 26
 #Starts hooks

+ 1
- 21
plugins/webui/__init__.py View File

@@ -1,22 +1,2 @@
1
-from lodel.settings.validator import SettingValidator
2
-
3 1
 __loader__ = 'main.py'
4
-
5
-CONFSPEC = {
6
-    'lodel2.webui': {
7
-        'standalone': ( False,
8
-                        SettingValidator('bool')),
9
-        'listen_address': ( '127.0.0.1',
10
-                            SettingValidator('dummy')),
11
-        'listen_port': (    '9090',
12
-                            SettingValidator('int')),
13
-    },
14
-    'lodel2.webui.sessions': {
15
-        'directory': (  '/tmp/lodel2_session',
16
-                        SettingValidator('path')),
17
-        'expiration': ( 900,
18
-                        SettingValidator('int')),
19
-        'file_template': (  'lodel2_%s.sess',
20
-                            SettingValidator('dummy')),
21
-    }
22
-}
2
+__confspec__ = 'confspec.py'

+ 20
- 0
plugins/webui/confspec.py View File

@@ -0,0 +1,20 @@
1
+from lodel.settings.validator import SettingValidator
2
+
3
+CONFSPEC = {
4
+    'lodel2.webui': {
5
+        'standalone': ( False,
6
+                        SettingValidator('bool')),
7
+        'listen_address': ( '127.0.0.1',
8
+                            SettingValidator('dummy')),
9
+        'listen_port': (    '9090',
10
+                            SettingValidator('int')),
11
+    },
12
+    'lodel2.webui.sessions': {
13
+        'directory': (  '/tmp/lodel2_session',
14
+                        SettingValidator('path')),
15
+        'expiration': ( 900,
16
+                        SettingValidator('int')),
17
+        'file_template': (  'lodel2_%s.sess',
18
+                            SettingValidator('dummy')),
19
+    }
20
+}

Loading…
Cancel
Save