Bläddra i källkod

Separate the controllers function in multiples files

Yann Weber 8 år sedan
förälder
incheckning
f02bba37f2

Binär
examples/em_test.pickle Visa fil


+ 2
- 0
plugins/webui/interface/controllers/__init__.py Visa fil

@@ -0,0 +1,2 @@
1
+from .base import *
2
+from .admin import *

+ 5
- 0
plugins/webui/interface/controllers/admin.py Visa fil

@@ -0,0 +1,5 @@
1
+
2
+def admin(request):
3
+    return get_response('admin/admin.html')
4
+
5
+

plugins/webui/interface/controllers.py → plugins/webui/interface/controllers/base.py Visa fil

@@ -1,7 +1,7 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3 3
 from werkzeug.wrappers import Response
4
-from .template.loader import TemplateLoader
4
+from ..template.loader import TemplateLoader
5 5
 
6 6
 # This module contains the web UI controllers that will be called from the web ui class
7 7
 
@@ -13,10 +13,6 @@ def get_response(tpl, mimetype='text/html', status_code=200):
13 13
     return response
14 14
 
15 15
 
16
-def admin(request):
17
-    return get_response('admin/admin.html')
18
-
19
-
20 16
 def index(request):
21 17
     return get_response('index/index.html')
22 18
 
@@ -32,4 +28,4 @@ def test(request):
32 28
 def list_classes(request):
33 29
     # TODO Add the method to get the classes list
34 30
 
35
-    return get_response('list_classes.html')
31
+    return get_response('list_classes.html')

Loading…
Avbryt
Spara