[prev in list] [next in list] [prev in thread] [next in thread]
List: calendarserver-changes
Subject: [CalendarServer-changes] [11623] CalendarServer/trunk/txdav
From: source_changes () macosforge ! org
Date: 2013-08-20 23:19:15
Message-ID: 20130820231915.347B3140F0D () svn ! calendarserver ! org
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Revision: 11623
http://trac.calendarserver.org//changeset/11623
Author: gaya@apple.com
Date: 2013-08-20 16:19:14 -0700 (Tue, 20 Aug 2013)
Log Message:
-----------
remove name param from updateShare(), updateShareFromSharingInvitation(); clean group \
storage
Modified Paths:
--------------
CalendarServer/trunk/txdav/carddav/datastore/sql.py
CalendarServer/trunk/txdav/common/datastore/sql.py
Modified: CalendarServer/trunk/txdav/carddav/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/carddav/datastore/sql.py 2013-08-20 19:35:48 UTC (rev \
11622)
+++ CalendarServer/trunk/txdav/carddav/datastore/sql.py 2013-08-20 23:19:14 UTC (rev \
11623) @@ -337,6 +337,8 @@
AddressBookHome._register(EADDRESSBOOKTYPE)
+
+
class AddressBookSharingMixIn(SharingMixIn):
"""
Sharing code shared between AddressBook and AddressBookObject
@@ -359,7 +361,7 @@
@inlineCallbacks
def _isSharedOrInvited(self):
"""
- return a bool if this L{AddressBook} is shared or invited
+ return True if this L{AddressBook} is shared or invited
"""
sharedRows = []
if self.owned():
@@ -1103,7 +1105,7 @@
@inlineCallbacks
- def updateShare(self, shareeView, mode=None, status=None, message=None, \
name=None): + def updateShare(self, shareeView, mode=None, status=None, \
message=None): """
Update share mode, status, and message for a home child shared with
this (owned) L{CommonHomeChild}.
@@ -1124,9 +1126,6 @@
will be used as the default display name, or None to not update
@type message: L{str}
- @param name: The bind resource name or None to not update
- @type message: L{str}
-
@return: the name of the shared item in the sharee's home.
@rtype: a L{Deferred} which fires with a L{str}
"""
@@ -1138,8 +1137,7 @@
columnMap = dict([(k, v if v != "" else None)
for k, v in {bind.BIND_MODE:mode,
bind.BIND_STATUS:status,
- bind.MESSAGE:message,
- bind.RESOURCE_NAME:name}.iteritems() if v is not None])
+ bind.MESSAGE:message}.iteritems() if v is not None])
if len(columnMap):
@@ -1481,11 +1479,6 @@
self._initFromRow(tuple(rows[0]))
if self._kind == _ABO_KIND_GROUP:
- # generate "X-ADDRESSBOOKSERVER-MEMBER" properties
- # calc md5 and set size
- componentText = str((yield self.component()))
- self._md5 = hashlib.md5(componentText).hexdigest()
- self._size = len(componentText)
groupBindRows = yield \
AddressBookObject._bindForResourceIDAndHomeID.on(
self._txn, resourceID=self._resourceID, \
homeID=self._home._resourceID @@ -1791,6 +1784,7 @@
uid = component.resourceUID()
assert inserting or self._uid == uid # can't change UID. Should be checked \
in upper layers self._uid = uid
+ originalComponentText = str(component)
if self._kind == _ABO_KIND_GROUP:
memberAddresses = set(component.resourceMemberAddresses())
@@ -1828,33 +1822,27 @@
# missing uids and other cuaddrs e.g. user@example.com, are stored in \
same schema table
foreignMemberAddrs.extend(["urn:uuid:" + missingUID for missingUID in \
missingUIDs])
- # don't store group members in object text
- orginialComponentText = str(component)
+ # sort unique members
component.removeProperties("X-ADDRESSBOOKSERVER-MEMBER")
for memberAddress in sorted(list(memberAddresses)): # sort unique
component.addProperty(Property("X-ADDRESSBOOKSERVER-MEMBER", \
memberAddress))
-
- # use sorted for md5
componentText = str(component)
- self._md5 = hashlib.md5(componentText).hexdigest()
- self._componentChanged = orginialComponentText != componentText
- # remove members from component get new text
- self._component = deepcopy(component)
- component.removeProperties("X-ADDRESSBOOKSERVER-MEMBER")
- componentText = str(component)
- self._objectText = componentText
-
- #size for quota does not include group members
- self._size = len(componentText)
-
+ # remove unneeded fields to get stored _objectText
+ thinComponent = deepcopy(component)
+ thinComponent.removeProperties("X-ADDRESSBOOKSERVER-MEMBER")
+ thinComponent.removeProperties("X-ADDRESSBOOKSERVER-KIND")
+ thinComponent.removeProperties("UID")
+ self._objectText = str(thinComponent)
else:
- self._component = component
componentText = str(component)
- self._md5 = hashlib.md5(componentText).hexdigest()
- self._size = len(componentText)
self._objectText = componentText
+ self._size = len(self._objectText)
+ self._component = component
+ self._md5 = hashlib.md5(componentText).hexdigest()
+ self._componentChanged = originalComponentText != componentText
+
# Special - if migrating we need to preserve the original md5
if self._txn._migrating and hasattr(component, "md5"):
self._md5 = component.md5
@@ -2031,6 +2019,8 @@
# now add the properties to the component
for memberAddress in sorted(memberAddresses + foreignMembers):
component.addProperty(Property("X-ADDRESSBOOKSERVER-MEMBER", \
memberAddress)) + \
component.addProperty(Property("X-ADDRESSBOOKSERVER-KIND", "group")) + \
component.addProperty(Property("UID", self._uid))
self._component = component
@@ -2284,7 +2274,7 @@
else:
if status == _BIND_STATUS_ACCEPTED:
shareeView = yield shareeHome.objectWithShareUID(bindName)
- yield shareeView._initSyncToken()
+ yield shareeView.addressbook()._initSyncToken()
yield shareeView._initBindRevision()
queryCacher = self._txn._queryCacher
@@ -2299,16 +2289,9 @@
@inlineCallbacks
- def _initSyncToken(self):
- yield self.addressbook()._initSyncToken()
-
-
- @inlineCallbacks
def _initBindRevision(self):
yield self.addressbook()._initBindRevision()
- # almost works
- # yield super(AddressBookObject, self)._initBindRevision()
bind = self._bindSchema
yield self._updateBindColumnsQuery(
{bind.BIND_REVISION : Parameter("revision"), }).on(
@@ -2321,8 +2304,7 @@
@inlineCallbacks
- # TODO: This is almost the same as AddressBook.updateShare(): combine
- def updateShare(self, shareeView, mode=None, status=None, message=None, \
name=None): + def updateShare(self, shareeView, mode=None, status=None, \
message=None): """
Update share mode, status, and message for a home child shared with
this (owned) L{CommonHomeChild}.
@@ -2343,9 +2325,6 @@
will be used as the default display name, or None to not update
@type message: L{str}
- @param name: The bind resource name or None to not update
- @type message: L{str}
-
@return: the name of the shared item in the sharee's home.
@rtype: a L{Deferred} which fires with a L{str}
"""
@@ -2357,8 +2336,7 @@
columnMap = dict([(k, v if v != "" else None)
for k, v in {bind.BIND_MODE:mode,
bind.BIND_STATUS:status,
- bind.MESSAGE:message,
- bind.RESOURCE_NAME:name}.iteritems() if v is not None])
+ bind.MESSAGE:message}.iteritems() if v is not None])
if len(columnMap):
@@ -2384,7 +2362,7 @@
shareeView._bindStatus = columnMap[bind.BIND_STATUS]
if shareeView._bindStatus == _BIND_STATUS_ACCEPTED:
if 0 == previouslyAcceptedBindCount:
- yield shareeView._initSyncToken()
+ yield shareeView.addressbook()._initSyncToken()
yield shareeView._initBindRevision()
\
shareeView.viewerHome()._children[self.addressbook().shareeName()] = \
shareeView.addressbook()
shareeView.viewerHome()._children[shareeView._resourceID] = \
shareeView.addressbook()
Modified: CalendarServer/trunk/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql.py 2013-08-20 19:35:48 UTC (rev \
11622)
+++ CalendarServer/trunk/txdav/common/datastore/sql.py 2013-08-20 23:19:14 UTC (rev \
11623) @@ -2931,7 +2931,7 @@
@inlineCallbacks
- def updateShareFromSharingInvitation(self, invitation, mode=None, status=None, \
message=None, name=None): + def updateShareFromSharingInvitation(self, invitation, \
mode=None, status=None, message=None): """
Like L{updateShare} except that the original invitation is provided. That is \
used
to find the actual sharee L{CommonHomeChild} which is then passed to \
L{updateShare}. @@ -2944,12 +2944,12 @@
if shareeView is None:
shareeView = yield \
shareeHome.invitedObjectWithShareUID(invitation.uid())
- result = yield self.updateShare(shareeView, mode, status, message, name)
+ result = yield self.updateShare(shareeView, mode, status, message)
returnValue(result)
@inlineCallbacks
- def updateShare(self, shareeView, mode=None, status=None, message=None, \
name=None): + def updateShare(self, shareeView, mode=None, status=None, \
message=None): """
Update share mode, status, and message for a home child shared with
this (owned) L{CommonHomeChild}.
@@ -2970,9 +2970,6 @@
will be used as the default display name, or None to not update
@type message: L{str}
- @param name: The bind resource name or None to not update
- @type message: L{str}
-
@return: the name of the shared item in the sharee's home.
@rtype: a L{Deferred} which fires with a L{str}
"""
@@ -2984,8 +2981,7 @@
columnMap = dict([(k, v if v != "" else None)
for k, v in {bind.BIND_MODE:mode,
bind.BIND_STATUS:status,
- bind.MESSAGE:message,
- bind.RESOURCE_NAME:name}.iteritems() if v is not None])
+ bind.MESSAGE:message}.iteritems() if v is not None])
if len(columnMap):
[Attachment #5 (text/html)]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[11623] CalendarServer/trunk/txdav</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: \
bold} #msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
.info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a \
href="http://trac.calendarserver.org//changeset/11623">11623</a></dd> <dt>Author</dt> \
<dd>gaya@apple.com</dd> <dt>Date</dt> <dd>2013-08-20 16:19:14 -0700 (Tue, 20 Aug \
2013)</dd> </dl>
<h3>Log Message</h3>
<pre>remove name param from updateShare(), updateShareFromSharingInvitation(); clean \
group storage</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunktxdavcarddavdatastoresqlpy">CalendarServer/trunk/txdav/carddav/datastore/sql.py</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresqlpy">CalendarServer/trunk/txdav/common/datastore/sql.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunktxdavcarddavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: \
CalendarServer/trunk/txdav/carddav/datastore/sql.py (11622 => 11623)</h4> <pre \
class="diff"><span> <span class="info">--- \
CalendarServer/trunk/txdav/carddav/datastore/sql.py 2013-08-20 19:35:48 UTC (rev \
11622)
+++ CalendarServer/trunk/txdav/carddav/datastore/sql.py 2013-08-20 23:19:14 UTC (rev \
11623) </span><span class="lines">@@ -337,6 +337,8 @@
</span><span class="cx">
</span><span class="cx"> AddressBookHome._register(EADDRESSBOOKTYPE)
</span><span class="cx">
</span><ins>+
+
</ins><span class="cx"> class AddressBookSharingMixIn(SharingMixIn):
</span><span class="cx"> """
</span><span class="cx"> Sharing code shared between AddressBook and \
AddressBookObject </span><span class="lines">@@ -359,7 +361,7 @@
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def _isSharedOrInvited(self):
</span><span class="cx"> """
</span><del>- return a bool if this L{AddressBook} is shared or invited
</del><ins>+ return True if this L{AddressBook} is shared or invited
</ins><span class="cx"> """
</span><span class="cx"> sharedRows = []
</span><span class="cx"> if self.owned():
</span><span class="lines">@@ -1103,7 +1105,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>- def updateShare(self, shareeView, mode=None, status=None, \
message=None, name=None): </del><ins>+ def updateShare(self, shareeView, \
mode=None, status=None, message=None): </ins><span class="cx"> \
""" </span><span class="cx"> Update share mode, status, and \
message for a home child shared with </span><span class="cx"> this (owned) \
L{CommonHomeChild}. </span><span class="lines">@@ -1124,9 +1126,6 @@
</span><span class="cx"> will be used as the default display name, or \
None to not update </span><span class="cx"> @type message: L{str}
</span><span class="cx">
</span><del>- @param name: The bind resource name or None to not update
- @type message: L{str}
-
</del><span class="cx"> @return: the name of the shared item in the sharee's \
home. </span><span class="cx"> @rtype: a L{Deferred} which fires with a \
L{str} </span><span class="cx"> """
</span><span class="lines">@@ -1138,8 +1137,7 @@
</span><span class="cx"> columnMap = dict([(k, v if v != "" else \
None) </span><span class="cx"> for k, v in \
{bind.BIND_MODE:mode, </span><span class="cx"> \
bind.BIND_STATUS:status, </span><del>- \
bind.MESSAGE:message,
- bind.RESOURCE_NAME:name}.iteritems() if v is not None])
</del><ins>+ bind.MESSAGE:message}.iteritems() if v is not \
None]) </ins><span class="cx">
</span><span class="cx"> if len(columnMap):
</span><span class="cx">
</span><span class="lines">@@ -1481,11 +1479,6 @@
</span><span class="cx"> self._initFromRow(tuple(rows[0]))
</span><span class="cx">
</span><span class="cx"> if self._kind == _ABO_KIND_GROUP:
</span><del>- # generate "X-ADDRESSBOOKSERVER-MEMBER" \
properties
- # calc md5 and set size
- componentText = str((yield self.component()))
- self._md5 = hashlib.md5(componentText).hexdigest()
- self._size = len(componentText)
</del><span class="cx">
</span><span class="cx"> groupBindRows = yield \
AddressBookObject._bindForResourceIDAndHomeID.on( </span><span class="cx"> \
self._txn, resourceID=self._resourceID, homeID=self._home._resourceID </span><span \
class="lines">@@ -1791,6 +1784,7 @@ </span><span class="cx"> uid = \
component.resourceUID() </span><span class="cx"> assert inserting or \
self._uid == uid # can't change UID. Should be checked in upper layers </span><span \
class="cx"> self._uid = uid </span><ins>+ originalComponentText = \
str(component) </ins><span class="cx">
</span><span class="cx"> if self._kind == _ABO_KIND_GROUP:
</span><span class="cx"> memberAddresses = \
set(component.resourceMemberAddresses()) </span><span class="lines">@@ -1828,33 \
+1822,27 @@ </span><span class="cx"> # missing uids and other cuaddrs \
e.g. user@example.com, are stored in same schema table </span><span class="cx"> \
foreignMemberAddrs.extend(["urn:uuid:" + missingUID for missingUID in \
missingUIDs]) </span><span class="cx">
</span><del>- # don't store group members in object text
- orginialComponentText = str(component)
</del><ins>+ # sort unique members
</ins><span class="cx"> \
component.removeProperties("X-ADDRESSBOOKSERVER-MEMBER") </span><span \
class="cx"> for memberAddress in sorted(list(memberAddresses)): # sort \
unique </span><span class="cx"> \
component.addProperty(Property("X-ADDRESSBOOKSERVER-MEMBER", \
memberAddress)) </span><del>-
- # use sorted for md5
</del><span class="cx"> componentText = str(component)
</span><del>- self._md5 = hashlib.md5(componentText).hexdigest()
- self._componentChanged = orginialComponentText != componentText
</del><span class="cx">
</span><del>- # remove members from component get new text
- self._component = deepcopy(component)
- component.removeProperties("X-ADDRESSBOOKSERVER-MEMBER")
- componentText = str(component)
- self._objectText = componentText
-
- #size for quota does not include group members
- self._size = len(componentText)
-
</del><ins>+ # remove unneeded fields to get stored _objectText
+ thinComponent = deepcopy(component)
+ thinComponent.removeProperties("X-ADDRESSBOOKSERVER-MEMBER")
+ thinComponent.removeProperties("X-ADDRESSBOOKSERVER-KIND")
+ thinComponent.removeProperties("UID")
+ self._objectText = str(thinComponent)
</ins><span class="cx"> else:
</span><del>- self._component = component
</del><span class="cx"> componentText = str(component)
</span><del>- self._md5 = hashlib.md5(componentText).hexdigest()
- self._size = len(componentText)
</del><span class="cx"> self._objectText = componentText
</span><span class="cx">
</span><ins>+ self._size = len(self._objectText)
+ self._component = component
+ self._md5 = hashlib.md5(componentText).hexdigest()
+ self._componentChanged = originalComponentText != componentText
+
</ins><span class="cx"> # Special - if migrating we need to preserve the \
original md5 </span><span class="cx"> if self._txn._migrating and \
hasattr(component, "md5"): </span><span class="cx"> self._md5 = \
component.md5 </span><span class="lines">@@ -2031,6 +2019,8 @@
</span><span class="cx"> # now add the properties to the \
component </span><span class="cx"> for memberAddress in \
sorted(memberAddresses + foreignMembers): </span><span class="cx"> \
component.addProperty(Property("X-ADDRESSBOOKSERVER-MEMBER", \
memberAddress)) </span><ins>+ \
component.addProperty(Property("X-ADDRESSBOOKSERVER-KIND", \
"group")) + \
component.addProperty(Property("UID", self._uid)) </ins><span class="cx">
</span><span class="cx"> self._component = component
</span><span class="cx">
</span><span class="lines">@@ -2284,7 +2274,7 @@
</span><span class="cx"> else:
</span><span class="cx"> if status == _BIND_STATUS_ACCEPTED:
</span><span class="cx"> shareeView = yield \
shareeHome.objectWithShareUID(bindName) </span><del>- yield \
shareeView._initSyncToken() </del><ins>+ yield \
shareeView.addressbook()._initSyncToken() </ins><span class="cx"> \
yield shareeView._initBindRevision() </span><span class="cx">
</span><span class="cx"> queryCacher = self._txn._queryCacher
</span><span class="lines">@@ -2299,16 +2289,9 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>- def _initSyncToken(self):
- yield self.addressbook()._initSyncToken()
-
-
- @inlineCallbacks
</del><span class="cx"> def _initBindRevision(self):
</span><span class="cx"> yield self.addressbook()._initBindRevision()
</span><span class="cx">
</span><del>- # almost works
- # yield super(AddressBookObject, self)._initBindRevision()
</del><span class="cx"> bind = self._bindSchema
</span><span class="cx"> yield self._updateBindColumnsQuery(
</span><span class="cx"> {bind.BIND_REVISION : \
Parameter("revision"), }).on( </span><span class="lines">@@ -2321,8 +2304,7 \
@@ </span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>- # TODO: This is almost the same as AddressBook.updateShare(): \
combine
- def updateShare(self, shareeView, mode=None, status=None, message=None, \
name=None): </del><ins>+ def updateShare(self, shareeView, mode=None, status=None, \
message=None): </ins><span class="cx"> """
</span><span class="cx"> Update share mode, status, and message for a home \
child shared with </span><span class="cx"> this (owned) L{CommonHomeChild}.
</span><span class="lines">@@ -2343,9 +2325,6 @@
</span><span class="cx"> will be used as the default display name, or \
None to not update </span><span class="cx"> @type message: L{str}
</span><span class="cx">
</span><del>- @param name: The bind resource name or None to not update
- @type message: L{str}
-
</del><span class="cx"> @return: the name of the shared item in the sharee's \
home. </span><span class="cx"> @rtype: a L{Deferred} which fires with a \
L{str} </span><span class="cx"> """
</span><span class="lines">@@ -2357,8 +2336,7 @@
</span><span class="cx"> columnMap = dict([(k, v if v != "" else \
None) </span><span class="cx"> for k, v in \
{bind.BIND_MODE:mode, </span><span class="cx"> \
bind.BIND_STATUS:status, </span><del>- \
bind.MESSAGE:message,
- bind.RESOURCE_NAME:name}.iteritems() if v is not None])
</del><ins>+ bind.MESSAGE:message}.iteritems() if v is not \
None]) </ins><span class="cx">
</span><span class="cx"> if len(columnMap):
</span><span class="cx">
</span><span class="lines">@@ -2384,7 +2362,7 @@
</span><span class="cx"> shareeView._bindStatus = \
columnMap[bind.BIND_STATUS] </span><span class="cx"> if \
shareeView._bindStatus == _BIND_STATUS_ACCEPTED: </span><span class="cx"> \
if 0 == previouslyAcceptedBindCount: </span><del>- yield \
shareeView._initSyncToken() </del><ins>+ yield \
shareeView.addressbook()._initSyncToken() </ins><span class="cx"> \
yield shareeView._initBindRevision() </span><span class="cx"> \
shareeView.viewerHome()._children[self.addressbook().shareeName()] = \
shareeView.addressbook() </span><span class="cx"> \
shareeView.viewerHome()._children[shareeView._resourceID] = shareeView.addressbook() \
</span></span></pre></div> <a id="CalendarServertrunktxdavcommondatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql.py \
(11622 => 11623)</h4> <pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql.py 2013-08-20 \
19:35:48 UTC (rev 11622)
+++ CalendarServer/trunk/txdav/common/datastore/sql.py 2013-08-20 23:19:14 UTC (rev \
11623) </span><span class="lines">@@ -2931,7 +2931,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>- def updateShareFromSharingInvitation(self, invitation, mode=None, \
status=None, message=None, name=None): </del><ins>+ def \
updateShareFromSharingInvitation(self, invitation, mode=None, status=None, \
message=None): </ins><span class="cx"> """
</span><span class="cx"> Like L{updateShare} except that the original \
invitation is provided. That is used </span><span class="cx"> to find the \
actual sharee L{CommonHomeChild} which is then passed to L{updateShare}. </span><span \
class="lines">@@ -2944,12 +2944,12 @@ </span><span class="cx"> if shareeView \
is None: </span><span class="cx"> shareeView = yield \
shareeHome.invitedObjectWithShareUID(invitation.uid()) </span><span class="cx">
</span><del>- result = yield self.updateShare(shareeView, mode, status, \
message, name) </del><ins>+ result = yield self.updateShare(shareeView, mode, \
status, message) </ins><span class="cx"> returnValue(result)
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>- def updateShare(self, shareeView, mode=None, status=None, \
message=None, name=None): </del><ins>+ def updateShare(self, shareeView, \
mode=None, status=None, message=None): </ins><span class="cx"> \
""" </span><span class="cx"> Update share mode, status, and \
message for a home child shared with </span><span class="cx"> this (owned) \
L{CommonHomeChild}. </span><span class="lines">@@ -2970,9 +2970,6 @@
</span><span class="cx"> will be used as the default display name, or \
None to not update </span><span class="cx"> @type message: L{str}
</span><span class="cx">
</span><del>- @param name: The bind resource name or None to not update
- @type message: L{str}
-
</del><span class="cx"> @return: the name of the shared item in the sharee's \
home. </span><span class="cx"> @rtype: a L{Deferred} which fires with a \
L{str} </span><span class="cx"> """
</span><span class="lines">@@ -2984,8 +2981,7 @@
</span><span class="cx"> columnMap = dict([(k, v if v != "" else \
None) </span><span class="cx"> for k, v in \
{bind.BIND_MODE:mode, </span><span class="cx"> \
bind.BIND_STATUS:status, </span><del>- \
bind.MESSAGE:message,
- bind.RESOURCE_NAME:name}.iteritems() if v is not None])
</del><ins>+ bind.MESSAGE:message}.iteritems() if v is not \
None]) </ins><span class="cx">
</span><span class="cx"> if len(columnMap):
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>
_______________________________________________
calendarserver-changes mailing list
calendarserver-changes@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/calendarserver-changes
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic