[Sync] Sync class changed: + provider, collection parameters, run returns void

This commit is contained in:
Roman Timashev committed 2017-09-11 18:20:38 +03:00
1 parent 6f065ccb93
commit fa71fc5cf1
2 files changed
+7 -7

No files matched your search

+2 -4
View File
@@ -21,9 +21,7 @@ logger = logging.getLogger(settings.name + '.Document')
class SyncDocument(Sync):
def __init__(self, provider: Provider, collection, sizes):
super().__init__()
self.collection = collection
self.provider = provider
super().__init__(provider, collection)
self.sizes = sizes
self.dir_static_previews = ''
@@ -32,7 +30,7 @@ class SyncDocument(Sync):
async def clean(self):
pass
async def run(self) -> ([Model], [Model]):
async def run(self):
logger.info('Checking documents for update')
documents = await Document.scan(self.provider)
+5 -3
View File
@@ -1,3 +1,4 @@
from sync.data import Provider
from sync.models import Model
from utils.fn import lmap
@@ -14,12 +15,13 @@ class Sync:
def compile(document):
return document.bake()
def __init__(self):
def __init__(self, provider: Provider, collection):
super().__init__()
self.collection = None
self.provider = provider
self.collection = collection
async def run(self) -> ([Model], [Model]):
async def run(self):
"""
# Get scope files
# Validate these files. Raise an error