iCloud Contacts Support, based on pull-request from joachimneu
This commit is contained in:
parent
ef85a5786a
commit
2623013b48
2 changed files with 14 additions and 1 deletions
|
@ -8,7 +8,8 @@ from pyicloud.exceptions import PyiCloudFailedLoginException
|
||||||
from pyicloud.services import (
|
from pyicloud.services import (
|
||||||
FindMyiPhoneServiceManager,
|
FindMyiPhoneServiceManager,
|
||||||
CalendarService,
|
CalendarService,
|
||||||
UbiquityService
|
UbiquityService,
|
||||||
|
ContactsService
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,6 +73,12 @@ class PyiCloudService(object):
|
||||||
)
|
)
|
||||||
self.params.update({'id': sha.hexdigest().upper()})
|
self.params.update({'id': sha.hexdigest().upper()})
|
||||||
|
|
||||||
|
clientId = str(uuid.uuid1()).upper()
|
||||||
|
self.params.update({
|
||||||
|
'clientBuildNumber': '14E45',
|
||||||
|
'clientId': clientId,
|
||||||
|
})
|
||||||
|
|
||||||
def authenticate(self):
|
def authenticate(self):
|
||||||
"""
|
"""
|
||||||
Handles the full authentication steps, validating,
|
Handles the full authentication steps, validating,
|
||||||
|
@ -126,6 +133,11 @@ class PyiCloudService(object):
|
||||||
service_root = self.webservices['calendar']['url']
|
service_root = self.webservices['calendar']['url']
|
||||||
return CalendarService(service_root, self.session, self.params)
|
return CalendarService(service_root, self.session, self.params)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def contacts(self):
|
||||||
|
service_root = self.webservices['contacts']['url']
|
||||||
|
return ContactsService(service_root, self.session, self.params)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return 'iCloud API: %s' % self.user.get('apple_id')
|
return 'iCloud API: %s' % self.user.get('apple_id')
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
from pyicloud.services.calendar import CalendarService
|
from pyicloud.services.calendar import CalendarService
|
||||||
from pyicloud.services.findmyiphone import FindMyiPhoneServiceManager
|
from pyicloud.services.findmyiphone import FindMyiPhoneServiceManager
|
||||||
from pyicloud.services.ubiquity import UbiquityService
|
from pyicloud.services.ubiquity import UbiquityService
|
||||||
|
from contacts import ContactsService
|
||||||
|
|
Loading…
Reference in a new issue