summaryrefslogtreecommitdiff
path: root/tools/mmd/MmdCommands.py
diff options
context:
space:
mode:
authorJogi Hofmüller <jogi@mur.at>2011-07-29 13:29:00 +0000
committerJogi Hofmüller <jogi@mur.at>2011-07-29 13:29:00 +0000
commit82f837989f1c2d9995db2311b36d1e94c66f70cc (patch)
treecad6296eb7fa328b129d4c807bf6100edc7365d5 /tools/mmd/MmdCommands.py
parentmoved software tests to tools (diff)
initial revision
git-svn-id: https://svn.spreadspace.org/mur.sat@71 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'tools/mmd/MmdCommands.py')
-rw-r--r--tools/mmd/MmdCommands.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/tools/mmd/MmdCommands.py b/tools/mmd/MmdCommands.py
new file mode 100644
index 0000000..1af9422
--- /dev/null
+++ b/tools/mmd/MmdCommands.py
@@ -0,0 +1,66 @@
+"""
+command methods for MURSAT1 Dashboard
+"""
+
+from cgi import parse_qs, escape
+from MmdWidgets import *
+
+def loginForm (data):
+ """
+ display the login form
+ """
+ return indexWidget (dataWidget (), loginFormWidget (), statusWidget (data['ip']))
+
+def login (data):
+ """
+ evaluate data from loginForm
+ """
+ email = escape (data['qs'].get ('email', [''])[0])
+ # check for account
+ # verify password
+ return indexWidget (dataWidget (), loginWidget (email), statusWidget (data['ip'], data['user']))
+
+def registerForm (data):
+ """
+ display the register form
+ """
+ return indexWidget (dataWidget (), registerFormWidget (), statusWidget (data['ip']))
+
+def register (data):
+ """
+ evaluate data from registerForm
+ """
+ return indexWidget (dataWidget (), loginWidget (), statusWidget (data['ip']))
+
+def submitForm (data):
+ """
+ display the form for data submission
+ """
+ return indexWidget (dataWidget (), submitFormWidget (), statusWidget (data['ip'], data['user']))
+
+def submit (data):
+ """
+ evaluate data from submitForm
+ """
+ return indexWidget (dataWidget (), submitWidget (), statusWidget (data['ip']))
+
+def viewlog (data):
+ """
+ show latest log entries/submissions
+ """
+ return indexWidget (dataWidget (), logWidget (), statusWidget (data['ip'], data['user']))
+
+def index (data):
+ """
+ display the index page
+ """
+ return indexWidget (dataWidget (), osmWidget (), statusWidget (data['ip'], data['user']))
+
+def msdbtest (env):
+ body = ''
+ for key, value in sorted (env.items()):
+ body = '{0}{1}: {2}\n'.format (body, key, value)
+ return body
+
+# vim: tw=0 ts=2 expandtab
+# EOF