sync: settings cleanup & update
This commit is contained in:
1 parent
6c99192122
commit
c5c89dcf61
3 files changed
+15
-8
No files matched your search
+12
-5
@@ -3,6 +3,13 @@ import os
|
|||||||
__author__ = 'Roman Timashev'
|
__author__ = 'Roman Timashev'
|
||||||
|
|
||||||
|
|
||||||
|
def absolute(path, ensure=True):
|
||||||
|
a = os.path.expanduser(path)
|
||||||
|
if ensure:
|
||||||
|
os.makedirs(a, exist_ok=True)
|
||||||
|
return a
|
||||||
|
|
||||||
|
|
||||||
def abs_fn(root):
|
def abs_fn(root):
|
||||||
return lambda path: os.path.join(root, path)
|
return lambda path: os.path.join(root, path)
|
||||||
|
|
||||||
@@ -30,7 +37,6 @@ teachers_names = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
image_processing = True
|
image_processing = True
|
||||||
image_save_dir = './static_images'
|
|
||||||
|
|
||||||
album_html_img_class = 'hudozka-product'
|
album_html_img_class = 'hudozka-product'
|
||||||
|
|
||||||
@@ -90,7 +96,7 @@ date_formats_reverse = [
|
|||||||
|
|
||||||
collection_documents = 'documents'
|
collection_documents = 'documents'
|
||||||
|
|
||||||
sync_provider_type = env('SYNC_PROVIDER')
|
sync_provider_type = env('SYNC_PROVIDER', 'fs')
|
||||||
|
|
||||||
_providers_roots = {
|
_providers_roots = {
|
||||||
'fs': abs_fn('/Users/tmshv/Yandex.Disk'),
|
'fs': abs_fn('/Users/tmshv/Yandex.Disk'),
|
||||||
@@ -102,14 +108,15 @@ dir_documents = f('Hudozka/Site/Documents')
|
|||||||
dir_events = f('Hudozka/Site/Events')
|
dir_events = f('Hudozka/Site/Events')
|
||||||
dir_news = f('Hudozka/Site/News')
|
dir_news = f('Hudozka/Site/News')
|
||||||
|
|
||||||
dir_static_uploads = '/Users/tmshv/Desktop/Hudozka Static/uploads'
|
dir_static = env('SYNC_STATIC', '~/Hudozka Static')
|
||||||
dir_static_images = '/Users/tmshv/Desktop/Hudozka Static/images'
|
dir_static_uploads = absolute(dir_static + '/uploads')
|
||||||
|
dir_static_images = absolute(dir_static + '/images')
|
||||||
|
|
||||||
url_base_preview = 'https://static.shburg.org/art/images/{id}-{size}{ext}'
|
url_base_preview = 'https://static.shburg.org/art/images/{id}-{size}{ext}'
|
||||||
url_base_document = 'https://static.shburg.org/art/uploads/{file}'
|
url_base_document = 'https://static.shburg.org/art/uploads/{file}'
|
||||||
|
|
||||||
image_base_url = 'https://static.shburg.org/art/images/'
|
image_base_url = 'https://static.shburg.org/art/images/'
|
||||||
image_name_format = '{type}-{id}-{img}-{size}{ext}'
|
image_name_format = '{type}-{id}-{img}-{size}{ext}'
|
||||||
image_output = '/Users/tmshv/Desktop/Hudozka Static/images'
|
|
||||||
|
|
||||||
yandex_disk_access_token = env('YANDEX_DISK_ACCESS_TOKEN')
|
yandex_disk_access_token = env('YANDEX_DISK_ACCESS_TOKEN')
|
||||||
|
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ def main(dir_documents, sync):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
image_creator = ImageCreator(cache=None)
|
image_creator = ImageCreator(cache=None)
|
||||||
alb = SyncAlbum(image_creator=image_creator, images_dir=settings.image_output)
|
alb = SyncAlbum(image_creator=image_creator, images_dir=settings.dir_static_images)
|
||||||
# alb.skip_image_processing = True
|
# alb.skip_image_processing = True
|
||||||
|
|
||||||
# dir_docs = '/Users/tmshv/Dropbox/Dev/Hud school/Gallery'
|
# dir_docs = '/Users/tmshv/Dropbox/Dev/Hud school/Gallery'
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ if __name__ == '__main__':
|
|||||||
'events',
|
'events',
|
||||||
None,
|
None,
|
||||||
image_url_base,
|
image_url_base,
|
||||||
settings.image_output,
|
settings.dir_static_images,
|
||||||
settings.event_image_sizes
|
settings.event_image_sizes
|
||||||
),
|
),
|
||||||
file_time_formats=['%Y.%m.%d']
|
file_time_formats=['%Y.%m.%d']
|
||||||
@@ -310,7 +310,7 @@ if __name__ == '__main__':
|
|||||||
'timeline',
|
'timeline',
|
||||||
'post',
|
'post',
|
||||||
image_url_base,
|
image_url_base,
|
||||||
settings.image_output,
|
settings.dir_static_images,
|
||||||
settings.event_image_sizes
|
settings.event_image_sizes
|
||||||
),
|
),
|
||||||
file_time_formats=settings.date_formats_reverse
|
file_time_formats=settings.date_formats_reverse
|
||||||
|
|||||||
Reference in new issue
Block a user