diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/__init__.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/server/__init__.py b/server/__init__.py index 861a7df..0007e0a 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -1,6 +1,5 @@ # coding=utf-8 -import multiprocessing.managers from . import user_session from . import prolog_session from . import python_session @@ -8,43 +7,3 @@ from . import socket import server.problems __all__ = ['socket', 'handlers', 'user_session', 'prolog_session', 'python_session', 'problems', 'start'] - - -# TODO: everything below is deprecated, remove it - -class Codeq(object): - _method_to_typeid_ = { - 'get_session_by_id': 'UserSession', - 'get_or_create_session': 'UserSession', - 'authenticate_and_create_session': 'UserSession' - } - - def get_session_by_id(self, sid): - return user_session.get_session_by_id(sid) - - def get_or_create_session(self, uid, username, sid=None): - return user_session.get_or_create_session(uid, username, sid) - - def authenticate_and_create_session(self, username, password): - return user_session.authenticate_and_create_session(username, password) - - def list_problems(self): - return server.problems.list_problems() - -class CodeqManager(multiprocessing.managers.BaseManager): - pass - -class UserSessionProxy(multiprocessing.managers.BaseProxy): - _method_to_typeid_ = {'get_prolog': 'PrologSession', 'get_python': 'PythonSession'} - -CodeqManager.register('PrologSession') -CodeqManager.register('PythonSession') -CodeqManager.register('UserSession', proxytype=UserSessionProxy) -#CodeqManager.register('get_session_by_id', callable=user_session.get_session_by_id, proxytype=UserSessionProxy) -#CodeqManager.register('get_or_create_session', callable=user_session.get_or_create_session, proxytype=UserSessionProxy) -#CodeqManager.register('authenticate_and_create_session', callable=user_session.authenticate_and_create_session, proxytype=UserSessionProxy) -CodeqManager.register('Codeq', callable=Codeq, method_to_typeid=Codeq._method_to_typeid_) - -def start(): - m = CodeqManager(address=('localhost', 16231), authkey=b'c0d3q3y') - m.get_server().serve_forever() |