summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-22 20:38:45 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-22 20:38:45 +0100
commit3b0f78439f70ede5dd0c24af39d7eb1b79b1446c (patch)
treea5946290c13a3e85fc4e1e67493fd0f26ba9fff9 /module/web
parentNCryptIn: Bug fixes (diff)
downloadpyload-3b0f78439f70ede5dd0c24af39d7eb1b79b1446c.tar.xz
filesonic info prefetching + premium fix
Diffstat (limited to 'module/web')
-rw-r--r--module/web/webinterface.py52
1 files changed, 10 insertions, 42 deletions
diff --git a/module/web/webinterface.py b/module/web/webinterface.py
index 54468d936..0e3c59730 100644
--- a/module/web/webinterface.py
+++ b/module/web/webinterface.py
@@ -39,49 +39,17 @@ from middlewares import StripPathMiddleware, GZipMiddleWare
SETUP = None
PYLOAD = None
-try:
- from module.web import ServerThread
-
- if not ServerThread.core:
- if ServerThread.setup:
- SETUP = ServerThread.setup
- config = SETUP.config
- else:
- raise Exception
+from module.web import ServerThread
+
+if not ServerThread.core:
+ if ServerThread.setup:
+ SETUP = ServerThread.setup
+ config = SETUP.config
else:
- PYLOAD = ServerThread.core.server_methods
- config = ServerThread.core.config
-except:
- import xmlrpclib
-
- from module.ConfigParser import ConfigParser
- config = ConfigParser()
-
- class wrap():
- authed = False
- proxy = None
- def checkAuth(self, username, password):
- server_url = "http%s://%s:%s@%s:%s/" % (
- "s" if config.get("ssl", "activated") else "",
- username,
- password,
- config.get("remote", "listenaddr"),
- config.get("remote", "port")
- )
- proxy = xmlrpclib.ServerProxy(server_url, allow_none=True)
- try:
- info = proxy.checkAuth(username, password)
- except:
- self.authed = False
- return {}
- self.proxy = proxy
- self.authed = False
- return info
-
- def __getattr__(self, attr):
- return getattr(self.proxy, attr)
-
- PYLOAD = wrap()
+ raise Exception("Could not access pyLoad Core")
+else:
+ PYLOAD = ServerThread.core.server_methods
+ config = ServerThread.core.config
from module.JsEngine import JsEngine