iCloud Contacts Support, based on pull-request from joachimneu

This commit is contained in:
Mario Mancino 2014-08-22 18:36:06 +02:00
parent ef85a5786a
commit 2623013b48
2 changed files with 14 additions and 1 deletions

View file

@ -8,7 +8,8 @@ from pyicloud.exceptions import PyiCloudFailedLoginException
from pyicloud.services import (
FindMyiPhoneServiceManager,
CalendarService,
UbiquityService
UbiquityService,
ContactsService
)
@ -72,6 +73,12 @@ class PyiCloudService(object):
)
self.params.update({'id': sha.hexdigest().upper()})
clientId = str(uuid.uuid1()).upper()
self.params.update({
'clientBuildNumber': '14E45',
'clientId': clientId,
})
def authenticate(self):
"""
Handles the full authentication steps, validating,
@ -126,6 +133,11 @@ class PyiCloudService(object):
service_root = self.webservices['calendar']['url']
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):
return 'iCloud API: %s' % self.user.get('apple_id')

View file

@ -1,3 +1,4 @@
from pyicloud.services.calendar import CalendarService
from pyicloud.services.findmyiphone import FindMyiPhoneServiceManager
from pyicloud.services.ubiquity import UbiquityService
from contacts import ContactsService