summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-08-25 14:20:42 +0200
committerAleš Smodiš <aless@guru.si>2015-08-25 14:20:42 +0200
commit88a5cd83b47a9dfb5a832936095c7b99ce0d8179 (patch)
treea01f0696da1d31201f42242cf61cbc664df65401 /client
parent816d11b6e238e389f84430196bed19d66f49d751 (diff)
Implemented methods to fetch a list of available problems and the problem description.
JavaScript no longer parses pythonic problem descriptions, instead they are loaded by server and JSONized.
Diffstat (limited to 'client')
-rw-r--r--client/__init__.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/client/__init__.py b/client/__init__.py
index 8781a96..1ac18cd 100644
--- a/client/__init__.py
+++ b/client/__init__.py
@@ -9,18 +9,28 @@ class CodeqManager(multiprocessing.managers.BaseManager):
CodeqManager.register('PrologSession')
CodeqManager.register('UserSession')
-CodeqManager.register('get_session_by_id')
-CodeqManager.register('get_or_create_session')
-CodeqManager.register('authenticate_and_create_session')
+#CodeqManager.register('get_session_by_id')
+#CodeqManager.register('get_or_create_session')
+#CodeqManager.register('authenticate_and_create_session')
+#CodeqManager.register('list_problems_in_groups')
+CodeqManager.register('Codeq')
m = CodeqManager(address=('localhost', 16231), authkey=b'c0d3q3y')
m.connect()
+codeq = m.Codeq()
def get_session_by_id(sid):
- return m.get_session_by_id(sid)
+# return m.get_session_by_id(sid)
+ return codeq.get_session_by_id(sid)
def get_or_create_session(uid, username, sid=None):
- return m.get_or_create_session(uid, username, sid)
+# return m.get_or_create_session(uid, username, sid)
+ return codeq.get_or_create_session(uid, username, sid)
def authenticate_and_create_session(username, password):
- return m.authenticate_and_create_session(username, password)
+# return m.authenticate_and_create_session(username, password)
+ return codeq.authenticate_and_create_session(username, password)
+
+def list_problems_in_groups(language):
+# return m.list_problems_in_groups(language)
+ return codeq.list_problems_in_groups(language)