mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use /cdb/cmd instead of /cdb/run
This commit is contained in:
parent
2064a5cd1b
commit
b33f00f0ff
@ -193,7 +193,7 @@ class DBCtx(object):
|
|||||||
def remote_run(self, name, m, *args):
|
def remote_run(self, name, m, *args):
|
||||||
from mechanize import HTTPError, Request
|
from mechanize import HTTPError, Request
|
||||||
from calibre.utils.serialize import msgpack_loads, msgpack_dumps
|
from calibre.utils.serialize import msgpack_loads, msgpack_dumps
|
||||||
url = self.url + '/cdb/run/{}/{}'.format(name, getattr(m, 'version', 0))
|
url = self.url + '/cdb/cmd/{}/{}'.format(name, getattr(m, 'version', 0))
|
||||||
if self.library_id:
|
if self.library_id:
|
||||||
url += '?' + urlencode({'library_id':self.library_id})
|
url += '?' + urlencode({'library_id':self.library_id})
|
||||||
rq = Request(url, data=msgpack_dumps(args),
|
rq = Request(url, data=msgpack_dumps(args),
|
||||||
|
@ -14,7 +14,7 @@ from calibre.utils.serialize import MSGPACK_MIME, msgpack_loads, json_loads
|
|||||||
receive_data_methods = {'GET', 'POST'}
|
receive_data_methods = {'GET', 'POST'}
|
||||||
|
|
||||||
|
|
||||||
@endpoint('/cdb/run/{which}/{version=0}', postprocess=msgpack_or_json, methods=receive_data_methods)
|
@endpoint('/cdb/cmd/{which}/{version=0}', postprocess=msgpack_or_json, methods=receive_data_methods)
|
||||||
def cdb_run(ctx, rd, which, version):
|
def cdb_run(ctx, rd, which, version):
|
||||||
try:
|
try:
|
||||||
m = module_for_cmd(which)
|
m = module_for_cmd(which)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user