mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-10 10:28:39 +00:00
fix calling core methods
This commit is contained in:
parent
1cfc057b05
commit
b74fdcf558
1 changed files with 4 additions and 4 deletions
|
@ -158,13 +158,13 @@ class JSON(resource.Resource, component.Component):
|
||||||
return meth(*params)
|
return meth(*params)
|
||||||
raise JSONException("Unknown system method")
|
raise JSONException("Unknown system method")
|
||||||
|
|
||||||
def _exec_remote(self, method, params):
|
def _exec_remote(self, method, params, request):
|
||||||
"""
|
"""
|
||||||
Executes methods using the Deluge client.
|
Executes methods using the Deluge client.
|
||||||
"""
|
"""
|
||||||
component.get("Auth").check_request(request, level=AUTH_LEVEL_DEFAULT)
|
component.get("Auth").check_request(request, level=AUTH_LEVEL_DEFAULT)
|
||||||
component, method = method.split(".")
|
core_component, method = method.split(".")
|
||||||
return getattr(getattr(client, component), method)(*params)
|
return getattr(getattr(client, core_component), method)(*params)
|
||||||
|
|
||||||
def _handle_request(self, request):
|
def _handle_request(self, request):
|
||||||
"""
|
"""
|
||||||
|
@ -190,7 +190,7 @@ class JSON(resource.Resource, component.Component):
|
||||||
if method.startswith("system.") or method in self._local_methods:
|
if method.startswith("system.") or method in self._local_methods:
|
||||||
result = self._exec_local(method, params, request)
|
result = self._exec_local(method, params, request)
|
||||||
elif method in self._remote_methods:
|
elif method in self._remote_methods:
|
||||||
result = self._exec_remote(method, params)
|
result = self._exec_remote(method, params, request)
|
||||||
else:
|
else:
|
||||||
error = {"message": "Unknown method", "code": 2}
|
error = {"message": "Unknown method", "code": 2}
|
||||||
except AuthError, e:
|
except AuthError, e:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue