Fix Python 3 issues in Photos service
This commit is contained in:
parent
254e6a7b44
commit
801ee8f7f7
2 changed files with 6 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
|||
import sys
|
||||
import json
|
||||
import urllib
|
||||
|
||||
from datetime import datetime
|
||||
from base64 import b64decode
|
||||
|
@ -11,6 +10,9 @@ from pyicloud.exceptions import (
|
|||
PyiCloudPhotoLibraryNotActivatedErrror
|
||||
)
|
||||
|
||||
from future.moves.urllib.parse import unquote
|
||||
from future.utils import listvalues, listitems
|
||||
|
||||
|
||||
class PhotosService(object):
|
||||
""" The 'Photos' iCloud service."""
|
||||
|
@ -188,7 +190,7 @@ class PhotoAlbum(object):
|
|||
orientation, self)
|
||||
previous_asset_id = asset_id
|
||||
|
||||
return assets.values()
|
||||
return listvalues(assets)
|
||||
|
||||
def _fetch_asset_data_for(self, asset):
|
||||
if asset.client_id in self.service._photo_assets:
|
||||
|
@ -268,7 +270,7 @@ class PhotoAsset(object):
|
|||
'height': height,
|
||||
'size': size,
|
||||
'mimetype': mimetype,
|
||||
'url': urllib.unquote(url),
|
||||
'url': unquote(url),
|
||||
'filename': filename,
|
||||
}
|
||||
return versions
|
||||
|
|
|
@ -6,3 +6,4 @@ six>=1.9.0
|
|||
tzlocal
|
||||
certifi
|
||||
bitstring
|
||||
future
|
||||
|
|
Loading…
Reference in a new issue