sync: fixed & updated
This commit is contained in:
1 parent
4a38abd13a
commit
a27a0cddce
5 files changed
+75
-58
No files matched your search
+16
-3
@@ -1,10 +1,11 @@
|
||||
import settings
|
||||
from sync.core.document import pdf_to_jpg
|
||||
from sync.core.document import pdf_to_jpg, SyncDocument
|
||||
from sync.data.fs import FSProvider
|
||||
from sync.data.yandexdisk import YDProvider
|
||||
from sync.document import sync_documents
|
||||
from sync.document import sync_documents, read_document, get_documents
|
||||
from utils.fn import lprint_json
|
||||
from utils.image.resize import image_magick_pdf_to_img
|
||||
from utils.text.transform import url_encode_text
|
||||
from yandexdisk import YDClient
|
||||
|
||||
|
||||
@@ -21,6 +22,8 @@ if __name__ == '__main__':
|
||||
|
||||
update = False
|
||||
delete = False
|
||||
# update = True
|
||||
# delete = True
|
||||
|
||||
if provider:
|
||||
u, d = sync_documents(provider, update=update, delete=delete)
|
||||
@@ -30,6 +33,16 @@ if __name__ == '__main__':
|
||||
print('UPDATE DOCUMENTS: %s' % ('NO' if not update else str(len(u))))
|
||||
lprint_json(u)
|
||||
|
||||
# s = SyncDocument(
|
||||
# {},
|
||||
# provider,
|
||||
# sizes=settings.image_sizes,
|
||||
# dir_static_previews=settings.dir_static_images,
|
||||
# url_base_preview=settings.url_base_preview,
|
||||
# url_base_document=settings.url_base_document,
|
||||
# )
|
||||
# # print(read_document(s, 'Награды/2016 В мире фантазий — Диплом.pdf'))
|
||||
# lprint_json(get_documents(s))
|
||||
|
||||
# print(api.scan('.'))
|
||||
# print(list(filter(
|
||||
@@ -41,7 +54,7 @@ if __name__ == '__main__':
|
||||
# print(api.size('./Архив/Устав 2013.pdf'))
|
||||
|
||||
# print(api.glob('./Архив/*.pdf'))
|
||||
# print(api.type_filter('./Архив', '.pdf'))
|
||||
# lprint_json(provider.type_filter('Награды', '.pdf'))
|
||||
|
||||
# path = api.type_filter('./Архив', '.pdf')[0]
|
||||
# print(api.copy(path, '/Users/tmshv/Desktop/fafo'))
|
||||
Reference in new issue
Block a user