Skip to content

Commit

Permalink
Fix filesystem storage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juho Kolehmainen committed May 14, 2017
1 parent d88731c commit fd0922d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions download_photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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..."
Expand Down Expand Up @@ -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.
Expand Down
File renamed without changes.
Empty file removed storage/__init__.py
Empty file.

0 comments on commit fd0922d

Please sign in to comment.