Browse Source

Enhancement in webui router : replacing imports

using LodelContext.expose_modules instead of imports
Yann Weber 7 years ago
parent
commit
e17c4f4468
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      lodel/plugins/webui/interface/router.py

+ 4
- 3
lodel/plugins/webui/interface/router.py View File

@@ -2,12 +2,13 @@
2 2
 import re
3 3
 
4 4
 from .controllers import *
5
-from .urls import urls
6
-from ..main import root_url
7 5
 
8 6
 from lodel.context import LodelContext
9 7
 LodelContext.expose_modules(globals(), {
10
-    'lodel.settings': ['Settings']})
8
+    'lodel.settings': ['Settings'],
9
+    'lodel.plugins.webui.main': ['root_url'],
10
+    'lodel.plugins.webui.interface.urls': ['urls'],
11
+})
11 12
 
12 13
 def format_url_rule(url_rule):
13 14
     if url_rule.startswith('^'):

Loading…
Cancel
Save