Load the CollectionWrapper from a factory method

This allows a class implementing CollectionWrapper's interface to be
added from config
This commit is contained in:
Anton Melser
2019-01-28 21:39:57 +08:00
parent 9ee9697582
commit fa89b0e0a2
4 changed files with 87 additions and 16 deletions

View File

@@ -388,7 +388,7 @@ class SyncApp:
valid_urls = SyncCollectionHandler.operations + SyncMediaHandler.operations + ['hostKey', 'upload', 'download']
def __init__(self, config):
from ankisyncd.thread import getCollectionManager
from ankisyncd.thread import get_collection_manager
self.data_root = os.path.abspath(config['data_root'])
self.base_url = config['base_url']
@@ -401,7 +401,7 @@ class SyncApp:
self.user_manager = get_user_manager(config)
self.session_manager = get_session_manager(config)
self.full_sync_manager = get_full_sync_manager(config)
self.collection_manager = getCollectionManager()
self.collection_manager = get_collection_manager(config)
# make sure the base_url has a trailing slash
if not self.base_url.endswith('/'):