From fd0922d4a4ac3893e8b13e9dcde4459ce908351e Mon Sep 17 00:00:00 2001 From: Juho Kolehmainen Date: Mon, 15 May 2017 00:53:37 +0300 Subject: [PATCH] Fix filesystem storage. --- download_photos.py | 12 ++++++------ storage/filesystem.py => filesystem.py | 0 storage/__init__.py | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename storage/filesystem.py => filesystem.py (100%) delete mode 100644 storage/__init__.py diff --git a/download_photos.py b/download_photos.py index 5c2ad0997..96f2c05ef 100755 --- a/download_photos.py +++ b/download_photos.py @@ -6,7 +6,7 @@ import time from tqdm import tqdm from dateutil.parser import parse -from storage.filesystem import FileSystemStorage +from filesystem import FileSystemStorage from photostation import PhotoStationService import pyicloud @@ -55,7 +55,7 @@ def download(directory, photostation, username, password, size, recent, \ if photostation: directory = PhotoStationService(photostation, directory) else: - directory = FileSystemStorage(directory) + directory = FileSystemStorage(directory) icloud = authenticate(username, password) updatePhotos(icloud) @@ -120,8 +120,8 @@ def download(directory, photostation, username, password, size, recent, \ album = directory.album(date_path, create=False) if album: - filename = filename_with_size(media, size) - album.photo(filename).delete() + filename = filename_with_size(media, size) + album.photo(filename).delete() def authenticate(username, password): print "Signing in..." @@ -182,8 +182,8 @@ def filename_with_size(photo, size): if size == 'original': return photo.filename.encode('utf-8') else: - return photo.filename.encode('utf-8') \ - .decode('ascii', 'ignore').replace('.', '-%s.' % size) + return photo.filename.encode('utf-8') \ + .decode('ascii', 'ignore').replace('.', '-%s.' % size) def download_photo(photo, size, force_size, album, progress_bar): # Strip any non-ascii characters. diff --git a/storage/filesystem.py b/filesystem.py similarity index 100% rename from storage/filesystem.py rename to filesystem.py diff --git a/storage/__init__.py b/storage/__init__.py deleted file mode 100644 index e69de29bb..000000000