[CalendarServer-changes] [9203] CalendarServer/branches/users/glyph/sharing-api
source_changes at macosforge.org
source_changes at macosforge.org
Thu Apr 26 17:09:15 PDT 2012
Revision: 9203
http://trac.macosforge.org/projects/calendarserver/changeset/9203
Author: glyph at apple.com
Date: 2012-04-26 17:09:14 -0700 (Thu, 26 Apr 2012)
Log Message:
-----------
Switch from shareWithUID to just shareWith so we don't have to deal with the issue of a not-yet-provisioned home.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/sharing-api/txdav/caldav/datastore/test/common.py
CalendarServer/branches/users/glyph/sharing-api/txdav/common/datastore/sql.py
Property Changed:
----------------
CalendarServer/branches/users/glyph/sharing-api/
Modified: CalendarServer/branches/users/glyph/sharing-api/txdav/caldav/datastore/test/common.py
===================================================================
--- CalendarServer/branches/users/glyph/sharing-api/txdav/caldav/datastore/test/common.py 2012-04-27 00:09:11 UTC (rev 9202)
+++ CalendarServer/branches/users/glyph/sharing-api/txdav/caldav/datastore/test/common.py 2012-04-27 00:09:14 UTC (rev 9203)
@@ -985,13 +985,14 @@
@inlineCallbacks
- def test_shareWithUID(self):
+ def test_shareWith(self):
"""
- L{ICalendar.shareWithUID} will share a calendar with a given home UID.
+ L{ICalendar.shareWith} will share a calendar with a given home UID.
"""
cal = yield self.calendarUnderTest()
OTHER_HOME_UID = "home_splits"
- newCalName = yield cal.shareWithUID(OTHER_HOME_UID, _BIND_MODE_WRITE)
+ other = yield self.calendarUnderTest(OTHER_HOME_UID)
+ newCalName = yield cal.shareWith(other, _BIND_MODE_WRITE)
yield self.commit()
normalCal = yield self.calendarUnderTest()
otherHome = yield self.homeUnderTest(name=OTHER_HOME_UID)
Modified: CalendarServer/branches/users/glyph/sharing-api/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/glyph/sharing-api/txdav/common/datastore/sql.py 2012-04-27 00:09:11 UTC (rev 9202)
+++ CalendarServer/branches/users/glyph/sharing-api/txdav/common/datastore/sql.py 2012-04-27 00:09:14 UTC (rev 9203)
@@ -1959,20 +1959,20 @@
@inlineCallbacks
- def shareWithUID(self, homeUID, mode):
+ def shareWith(self, shareeHome, mode):
"""
- Share this (owned) L{CommonHomeChild} with another home UID.
+ Share this (owned) L{CommonHomeChild} with another home.
- @param homeUID: the UID of the home of the sharee.
- @type homeUID: L{str}
+ @param shareeHome: The home of the sharee.
+ @type shareeHome: L{CommonHome}
@param mode: The sharing mode; L{_BIND_MODE_READ} or
L{_BIND_MODE_WRITE}.
@type mode: L{str}
@return: the name of the shared calendar in the new calendar home.
+ @rtype: L{str}
"""
- shareeHome = yield self._txn.calendarHomeWithUID(homeUID)
dn = PropertyName.fromElement(DisplayName)
dnprop = (self.properties().get(dn) or
DisplayName.fromString(self.name()))
@@ -1987,9 +1987,9 @@
yield self._insertInviteQuery.on(
self._txn, uid=newName, name=str(dnprop),
homeID=shareeHome._resourceID, resourceID=self._resourceID,
- recipient=homeUID
+ recipient=shareeHome.uid()
)
- shareeProps = yield PropertyStore.load(homeUID, self._txn,
+ shareeProps = yield PropertyStore.load(shareeHome.uid(), self._txn,
self._resourceID)
shareeProps[dn] = dnprop
returnValue(newName)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120426/8265feba/attachment-0001.html>
More information about the calendarserver-changes
mailing list