浏览代码

Bugfix in webui plugin

Avoid useless impossible import by putting confpsec in a dedicated file
Yann Weber 8 年前
父节点
当前提交
ee06ccf1eb
共有 3 个文件被更改,包括 23 次插入22 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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
+}

正在加载...
取消
保存