mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Remove unecessary indirection
This commit is contained in:
parent
623c0537e1
commit
7c9170c677
2 changed files with 12 additions and 9 deletions
|
|
@ -125,13 +125,16 @@ def sync(ctx, collections, force_delete):
|
|||
from .tasks import prepare_pair, sync_collection
|
||||
|
||||
for pair_name, collections in collections:
|
||||
prepare_pair(
|
||||
for collection, config in prepare_pair(
|
||||
pair_name=pair_name,
|
||||
collections=collections,
|
||||
config=ctx.config,
|
||||
force_delete=force_delete,
|
||||
callback=sync_collection,
|
||||
)
|
||||
):
|
||||
sync_collection(
|
||||
collection=collection,
|
||||
general=config,
|
||||
force_delete=force_delete,
|
||||
)
|
||||
|
||||
|
||||
@app.command()
|
||||
|
|
@ -147,12 +150,12 @@ def metasync(ctx, collections):
|
|||
from .tasks import prepare_pair, metasync_collection
|
||||
|
||||
for pair_name, collections in collections:
|
||||
prepare_pair(
|
||||
for collection, config in prepare_pair(
|
||||
pair_name=pair_name,
|
||||
collections=collections,
|
||||
config=ctx.config,
|
||||
callback=metasync_collection,
|
||||
)
|
||||
):
|
||||
metasync_collection(collection=collection, general=config)
|
||||
|
||||
|
||||
@app.command()
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ from .utils import manage_sync_status
|
|||
from .utils import save_status
|
||||
|
||||
|
||||
def prepare_pair(pair_name, collections, config, callback, **kwargs):
|
||||
def prepare_pair(pair_name, collections, config):
|
||||
pair = config.get_pair(pair_name)
|
||||
|
||||
all_collections = dict(
|
||||
|
|
@ -34,7 +34,7 @@ def prepare_pair(pair_name, collections, config, callback, **kwargs):
|
|||
)
|
||||
|
||||
collection = CollectionConfig(pair, collection_name, config_a, config_b)
|
||||
callback(collection=collection, general=config.general, **kwargs)
|
||||
yield collection, config.general
|
||||
|
||||
|
||||
def sync_collection(collection, general, force_delete):
|
||||
|
|
|
|||
Loading…
Reference in a new issue