mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
...
This commit is contained in:
parent
98c4750746
commit
598c5058f8
@ -151,6 +151,9 @@ class Context(object):
|
|||||||
return old[1]
|
return old[1]
|
||||||
|
|
||||||
|
|
||||||
|
SRV_MODULES = ('ajax', 'books', 'cdb', 'code', 'content', 'legacy', 'opds')
|
||||||
|
|
||||||
|
|
||||||
class Handler(object):
|
class Handler(object):
|
||||||
|
|
||||||
def __init__(self, libraries, opts, testing=False, notify_changes=None):
|
def __init__(self, libraries, opts, testing=False, notify_changes=None):
|
||||||
@ -161,7 +164,7 @@ class Handler(object):
|
|||||||
prefer_basic_auth = {'auto':has_ssl, 'basic':True}.get(opts.auth_mode, False)
|
prefer_basic_auth = {'auto':has_ssl, 'basic':True}.get(opts.auth_mode, False)
|
||||||
self.auth_controller = AuthController(user_credentials=ctx.user_manager, prefer_basic_auth=prefer_basic_auth)
|
self.auth_controller = AuthController(user_credentials=ctx.user_manager, prefer_basic_auth=prefer_basic_auth)
|
||||||
self.router = Router(ctx=ctx, url_prefix=opts.url_prefix, auth_controller=self.auth_controller)
|
self.router = Router(ctx=ctx, url_prefix=opts.url_prefix, auth_controller=self.auth_controller)
|
||||||
for module in ('content', 'ajax', 'code', 'legacy', 'opds', 'books', 'cdb'):
|
for module in SRV_MODULES:
|
||||||
module = import_module('calibre.srv.' + module)
|
module = import_module('calibre.srv.' + module)
|
||||||
self.router.load_routes(vars(module).itervalues())
|
self.router.load_routes(vars(module).itervalues())
|
||||||
self.router.finalize()
|
self.router.finalize()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user