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 sys
|
||||||
import json
|
import json
|
||||||
import urllib
|
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from base64 import b64decode
|
from base64 import b64decode
|
||||||
|
@ -11,6 +10,9 @@ from pyicloud.exceptions import (
|
||||||
PyiCloudPhotoLibraryNotActivatedErrror
|
PyiCloudPhotoLibraryNotActivatedErrror
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from future.moves.urllib.parse import unquote
|
||||||
|
from future.utils import listvalues, listitems
|
||||||
|
|
||||||
|
|
||||||
class PhotosService(object):
|
class PhotosService(object):
|
||||||
""" The 'Photos' iCloud service."""
|
""" The 'Photos' iCloud service."""
|
||||||
|
@ -188,7 +190,7 @@ class PhotoAlbum(object):
|
||||||
orientation, self)
|
orientation, self)
|
||||||
previous_asset_id = asset_id
|
previous_asset_id = asset_id
|
||||||
|
|
||||||
return assets.values()
|
return listvalues(assets)
|
||||||
|
|
||||||
def _fetch_asset_data_for(self, asset):
|
def _fetch_asset_data_for(self, asset):
|
||||||
if asset.client_id in self.service._photo_assets:
|
if asset.client_id in self.service._photo_assets:
|
||||||
|
@ -268,7 +270,7 @@ class PhotoAsset(object):
|
||||||
'height': height,
|
'height': height,
|
||||||
'size': size,
|
'size': size,
|
||||||
'mimetype': mimetype,
|
'mimetype': mimetype,
|
||||||
'url': urllib.unquote(url),
|
'url': unquote(url),
|
||||||
'filename': filename,
|
'filename': filename,
|
||||||
}
|
}
|
||||||
return versions
|
return versions
|
||||||
|
|
|
@ -6,3 +6,4 @@ six>=1.9.0
|
||||||
tzlocal
|
tzlocal
|
||||||
certifi
|
certifi
|
||||||
bitstring
|
bitstring
|
||||||
|
future
|
||||||
|
|
Loading…
Reference in a new issue