fix CoreMethod
This commit is contained in:
parent
4fa375bd6c
commit
88f2638764
|
@ -229,7 +229,7 @@ class torrent_queue_up:
|
||||||
torrent_ids = [t.id for t in torrent_list]
|
torrent_ids = [t.id for t in torrent_list]
|
||||||
for torrent_id in torrent_ids:
|
for torrent_id in torrent_ids:
|
||||||
#async_proxy.get_core().call("queue_queue_up", None, torrent_id)
|
#async_proxy.get_core().call("queue_queue_up", None, torrent_id)
|
||||||
proxy.queue_queue_up(torrent_id)
|
async_proxy.queue_queue_up(None, torrent_id)
|
||||||
do_redirect()
|
do_redirect()
|
||||||
|
|
||||||
class torrent_queue_down:
|
class torrent_queue_down:
|
||||||
|
@ -241,7 +241,7 @@ class torrent_queue_down:
|
||||||
torrent_ids = [t.id for t in torrent_list]
|
torrent_ids = [t.id for t in torrent_list]
|
||||||
for torrent_id in reversed(torrent_ids):
|
for torrent_id in reversed(torrent_ids):
|
||||||
#async_proxy.get_core().call("queue_queue_down", None, torrent_id)
|
#async_proxy.get_core().call("queue_queue_down", None, torrent_id)
|
||||||
proxy.queue_queue_down(torrent_id)
|
async_proxy.queue_queue_down(None, torrent_id)
|
||||||
do_redirect()
|
do_redirect()
|
||||||
|
|
||||||
class torrent_files:
|
class torrent_files:
|
||||||
|
|
|
@ -99,8 +99,8 @@ CONFIG_DEFAULTS = {
|
||||||
"auto_refresh":False,
|
"auto_refresh":False,
|
||||||
"auto_refresh_secs": 10,
|
"auto_refresh_secs": 10,
|
||||||
"template":"advanced",
|
"template":"advanced",
|
||||||
"pwd_salt":"2540626806573060601127357001536142078273646936492343724296134859793541603059837926595027859394922651189016967573954758097008242073480355104215558310954",
|
"pwd_salt":"2\xe8\xc7\xa6(n\x81_\x8f\xfc\xdf\x8b\xd1\x1e\xd5\x90",
|
||||||
"pwd_md5":"\xea\x8d\x90\x98^\x9f\xa9\xe2\x19l\x7f\x1a\xca\x82u%",
|
"pwd_md5":".\xe8w\\+\xec\xdb\xf2id4F\xdb\rUc",
|
||||||
"cache_templates":False,
|
"cache_templates":False,
|
||||||
"use_https":False
|
"use_https":False
|
||||||
}
|
}
|
||||||
|
@ -142,24 +142,27 @@ class CoreMethod:
|
||||||
"""
|
"""
|
||||||
def __init__(self, method_name):
|
def __init__(self, method_name):
|
||||||
self.method_name = method_name
|
self.method_name = method_name
|
||||||
self.result = None
|
|
||||||
|
|
||||||
def __call__(self,*args,**kwargs):
|
def __call__(self, callback, *args,**kwargs):
|
||||||
client.get_core().call(self.method_name, self.callback ,*args, **kwargs)
|
client.get_core().call(self.method_name, callback ,*args, **kwargs)
|
||||||
return self.result
|
|
||||||
|
|
||||||
def callback(self, result):
|
|
||||||
self.result = result
|
|
||||||
|
|
||||||
class BlockingCoreMethod(CoreMethod):
|
class BlockingCoreMethod(CoreMethod):
|
||||||
"""
|
"""
|
||||||
for syncProcy
|
for syncProcy
|
||||||
"""
|
"""
|
||||||
|
def __init__(self, method_name):
|
||||||
|
self.method_name = method_name
|
||||||
|
self.result = None
|
||||||
|
|
||||||
def __call__(self,*args,**kwargs):
|
def __call__(self,*args,**kwargs):
|
||||||
client.get_core().call(self.method_name, self.callback ,*args, **kwargs)
|
client.get_core().call(self.method_name, self.callback ,*args, **kwargs)
|
||||||
client.force_call(block=True)
|
client.force_call(block=True)
|
||||||
return self.result
|
return self.result
|
||||||
|
|
||||||
|
def callback(self, result):
|
||||||
|
self.result = result
|
||||||
|
|
||||||
|
|
||||||
class SyncProxy(object):
|
class SyncProxy(object):
|
||||||
"""acts like the old synchonous proxy"""
|
"""acts like the old synchonous proxy"""
|
||||||
def __getattr__(self, method_name):
|
def __getattr__(self, method_name):
|
||||||
|
|
Loading…
Reference in New Issue