diff --git a/pyicloud/base.py b/pyicloud/base.py index b19ba4e..23e774e 100644 --- a/pyicloud/base.py +++ b/pyicloud/base.py @@ -1,4 +1,3 @@ -import time import uuid import hashlib import json @@ -115,7 +114,11 @@ class PyiCloudService(object): def files(self): if not hasattr(self, '_files'): service_root = self.webservices['ubiquity']['url'] - self._files = UbiquityService(service_root, self.session, self.params) + self._files = UbiquityService( + service_root, + self.session, + self.params + ) return self._files @property diff --git a/pyicloud/services/findmyiphone.py b/pyicloud/services/findmyiphone.py index 7a0a14c..29cfb5e 100755 --- a/pyicloud/services/findmyiphone.py +++ b/pyicloud/services/findmyiphone.py @@ -54,7 +54,7 @@ class FindMyiPhoneServiceManager(object): self._devices[device_id].update(device_info) if not self._devices: - raise PyiCloudNoDevicesException(message) + raise PyiCloudNoDevicesException() def __getitem__(self, key): if isinstance(key, int): @@ -79,8 +79,10 @@ class FindMyiPhoneServiceManager(object): class AppleDevice(object): - def __init__(self, content, session, params, manager, - sound_url=None, lost_url=None, message_url=None): + def __init__( + self, content, session, params, manager, + sound_url=None, lost_url=None, message_url=None + ): self.content = content self.manager = manager self.session = session @@ -122,26 +124,34 @@ class AppleDevice(object): data=data ) - def display_message (self, subject='Find My iPhone Alert', message="This is a note", sounds=False): + def display_message( + self, subject='Find My iPhone Alert', message="This is a note", + sounds=False + ): """ Send a request to the device to play a sound. It's possible to pass a custom message by changing the `subject`. """ - data = json.dumps({'device': self.content['id'], - 'subject': subject, - 'sound':sounds, - 'userText':True, - 'text':message - }) + data = json.dumps( + { + 'device': self.content['id'], + 'subject': subject, + 'sound': sounds, + 'userText': True, + 'text': message + } + ) self.session.post( self.message_url, params=self.params, data=data ) - def lost_device(self, number, - text='This iPhone has been lost. Please call me.', - newpasscode=""): + def lost_device( + self, number, + text='This iPhone has been lost. Please call me.', + newpasscode="" + ): """ Send a request to the device to trigger 'lost mode'. The device will show the message in `text`, and if a number has diff --git a/pyicloud/services/ubiquity.py b/pyicloud/services/ubiquity.py index b04ae08..86878e2 100644 --- a/pyicloud/services/ubiquity.py +++ b/pyicloud/services/ubiquity.py @@ -97,7 +97,9 @@ class UbiquityNode(object): return self.connection.get_file(self.item_id, **kwargs) def get(self, name): - return [child for child in self.get_children() if child.name == name][0] + return [ + child for child in self.get_children() if child.name == name + ][0] def __getitem__(self, key): try: