<!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>[13818] CalendarServer/trunk</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/13818">13818</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-08-01 10:59:51 -0700 (Fri, 01 Aug 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Whitespace.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertapcaldavpy">CalendarServer/trunk/calendarserver/tap/caldav.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertaptesttest_caldavpy">CalendarServer/trunk/calendarserver/tap/test/test_caldav.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavbackuppy">CalendarServer/trunk/twistedcaldav/backup.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavclientgeturlpy">CalendarServer/trunk/twistedcaldav/client/geturl.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavclientpoolpy">CalendarServer/trunk/twistedcaldav/client/pool.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavconfigpy">CalendarServer/trunk/twistedcaldav/config.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdatabasepy">CalendarServer/trunk/twistedcaldav/database.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdatafiltersperuserdatapy">CalendarServer/trunk/twistedcaldav/datafilters/peruserdata.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectoryaugmentpy">CalendarServer/trunk/twistedcaldav/directory/augment.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectoryprincipalpy">CalendarServer/trunk/twistedcaldav/directory/principal.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectorytesttest_digestpy">CalendarServer/trunk/twistedcaldav/directory/test/test_digest.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectorytesttest_principalpy">CalendarServer/trunk/twistedcaldav/directory/test/test_principal.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectorytesttest_proxyprincipaldbpy">CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectorybackedaddressbookpy">CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavextensionspy">CalendarServer/trunk/twistedcaldav/extensions.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavinstancepy">CalendarServer/trunk/twistedcaldav/instance.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavlocalizationpy">CalendarServer/trunk/twistedcaldav/localization.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavmemcacheclientpy">CalendarServer/trunk/twistedcaldav/memcacheclient.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavmemcachepropspy">CalendarServer/trunk/twistedcaldav/memcacheprops.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavmemcacherpy">CalendarServer/trunk/twistedcaldav/memcacher.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavmethodmkcolpy">CalendarServer/trunk/twistedcaldav/method/mkcol.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavmethodreport_addressbook_querypy">CalendarServer/trunk/twistedcaldav/method/report_addressbook_query.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavmethodreport_commonpy">CalendarServer/trunk/twistedcaldav/method/report_common.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavmethodreport_multiget_commonpy">CalendarServer/trunk/twistedcaldav/method/report_multiget_common.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavnotificationspy">CalendarServer/trunk/twistedcaldav/notifications.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavresourcepy">CalendarServer/trunk/twistedcaldav/resource.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavscheduling_storecaldavresourcepy">CalendarServer/trunk/twistedcaldav/scheduling_store/caldav/resource.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstorebridgepy">CalendarServer/trunk/twistedcaldav/storebridge.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_addressbookmultigetpy">CalendarServer/trunk/twistedcaldav/test/test_addressbookmultiget.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_cachepy">CalendarServer/trunk/twistedcaldav/test/test_cache.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_configpy">CalendarServer/trunk/twistedcaldav/test/test_config.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_icalendarpy">CalendarServer/trunk/twistedcaldav/test/test_icalendar.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_localizationpy">CalendarServer/trunk/twistedcaldav/test/test_localization.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_memcachepropspy">CalendarServer/trunk/twistedcaldav/test/test_memcacheprops.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_mkcalendarpy">CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_multigetpy">CalendarServer/trunk/twistedcaldav/test/test_multiget.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_wrappingpy">CalendarServer/trunk/twistedcaldav/test/test_wrapping.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavvcardpy">CalendarServer/trunk/twistedcaldav/vcard.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarservertapcaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/caldav.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/caldav.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -735,6 +735,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> class CalDAVServiceMaker (object):
</span><span class="cx"> log = Logger()
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertaptesttest_caldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/test/test_caldav.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/test/test_caldav.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/calendarserver/tap/test/test_caldav.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -1505,6 +1505,7 @@
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> class StubStorageService(object):
</span><span class="cx">
</span><span class="cx"> def __init__(self):
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavbackuppy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/backup.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/backup.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/backup.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -108,9 +108,10 @@
</span><span class="cx"> @logFuncCall
</span><span class="cx"> def serveradmin(action, service):
</span><span class="cx"> cmd = ' '.join((
</span><del>- SERVERADMIN,
- action,
- service))
</del><ins>+ SERVERADMIN,
+ action,
+ service
+ ))
</ins><span class="cx">
</span><span class="cx"> status, output = commands.getstatusoutput(cmd)
</span><span class="cx">
</span><span class="lines">@@ -124,9 +125,10 @@
</span><span class="cx"> @logFuncCall
</span><span class="cx"> def isRunning(service):
</span><span class="cx"> cmd = ' '.join((
</span><del>- SERVERADMIN,
- 'status',
- service))
</del><ins>+ SERVERADMIN,
+ 'status',
+ service
+ ))
</ins><span class="cx">
</span><span class="cx"> debug(cmd)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavclientgeturlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/client/geturl.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/client/geturl.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/client/geturl.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -56,8 +56,10 @@
</span><span class="cx">
</span><span class="cx"> def connectionMade(self):
</span><span class="cx"> self.made = 1
</span><del>- if (self.factory is not None and
- self.factory.protocolConnectionMade is not None):
</del><ins>+ if (
+ self.factory is not None and
+ self.factory.protocolConnectionMade is not None
+ ):
</ins><span class="cx"> d = self.factory.protocolConnectionMade
</span><span class="cx"> self.factory.protocolConnectionMade = None
</span><span class="cx"> d.callback(self)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavclientpoolpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/client/pool.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/client/pool.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/client/pool.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx"> self._pendingConnects += 1
</span><span class="cx">
</span><span class="cx"> self.log.debug("Initating new client connection to: %r" % (
</span><del>- self._endpoint,))
</del><ins>+ self._endpoint,))
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx"> factory = self.clientFactory(self._reactor)
</span><span class="lines">@@ -318,12 +318,14 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def _logClientStats(self):
</span><del>- self.log.debug("Clients #free: %d, #busy: %d, "
- "#pending: %d, #queued: %d" % (
</del><ins>+ self.log.debug(
+ "Clients #free: %d, #busy: %d, #pending: %d, #queued: %d" % (
</ins><span class="cx"> len(self._freeClients),
</span><span class="cx"> len(self._busyClients),
</span><span class="cx"> self._pendingConnects,
</span><del>- len(self._pendingRequests)))
</del><ins>+ len(self._pendingRequests)
+ )
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def clientGone(self, client):
</span><span class="lines">@@ -385,7 +387,7 @@
</span><span class="cx"> d, request, args, kwargs = self._pendingRequests.pop(0)
</span><span class="cx">
</span><span class="cx"> self.log.debug("Performing Queued Request: %s, %r, %r" % (
</span><del>- request, args, kwargs))
</del><ins>+ request, args, kwargs))
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx"> _ign_d = self._submitRequest(request, *args, **kwargs)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/config.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/config.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/config.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx"> parts = attr.split(".")
</span><span class="cx"> lastDict = self._data
</span><span class="cx"> for part in parts[:-1]:
</span><del>- if not part in lastDict:
</del><ins>+ if part not in lastDict:
</ins><span class="cx"> lastDict[attr] = ConfigDict()
</span><span class="cx"> lastDict = lastDict.__getattr__(part)
</span><span class="cx"> configItem = parts[-1]
</span><span class="lines">@@ -289,7 +289,8 @@
</span><span class="cx"> self._afterResetHook(self._data, preserved)
</span><span class="cx"> self.update(configDict, reloading=True)
</span><span class="cx"> else:
</span><del>- raise ConfigurationError("Invalid configuration in %s"
</del><ins>+ raise ConfigurationError(
+ "Invalid configuration in %s"
</ins><span class="cx"> % (self._provider.getConfigFileName(), ))
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdatabasepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/database.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/database.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/database.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx"> import pgdb
</span><span class="cx"> except:
</span><span class="cx"> pgdb = None
</span><del>-#pgdb = None
</del><ins>+# pgdb = None
</ins><span class="cx">
</span><span class="cx"> from twisted.enterprise.adbapi import ConnectionPool
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdatafiltersperuserdatapy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/datafilters/peruserdata.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/datafilters/peruserdata.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/datafilters/peruserdata.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx"> def _defaultFilter(self, ical):
</span><span class="cx"> """
</span><span class="cx"> There is no per-user component. Instead apply default properties to the data for this user.
</span><del>-
</del><ins>+
</ins><span class="cx"> @param ical: the iCalendar object to process
</span><span class="cx"> @type ical: L{Component}
</span><span class="cx"> """
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectoryaugmentpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directory/augment.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directory/augment.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/directory/augment.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx"> @return: L{Deferred}
</span><span class="cx"> """
</span><span class="cx">
</span><del>- if not uid in self.cachedRecords:
</del><ins>+ if uid not in self.cachedRecords:
</ins><span class="cx"> result = (yield self._lookupAugmentRecord(uid))
</span><span class="cx"> self.cachedRecords[uid] = result
</span><span class="cx"> returnValue(self.cachedRecords[uid])
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectoryprincipalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directory/principal.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directory/principal.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/directory/principal.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -134,8 +134,10 @@
</span><span class="cx"> return "recordName", id
</span><span class="cx">
</span><span class="cx"> else:
</span><del>- raise ValueError("Invalid calendar user address format: %s" %
- (origCUAddr,))
</del><ins>+ raise ValueError(
+ "Invalid calendar user address format: %s" %
+ (origCUAddr,)
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -228,18 +230,15 @@
</span><span class="cx"> ("DAV:" , "displayname") :
</span><span class="cx"> ("fullNames", None, "Display Name", davxml.DisplayName),
</span><span class="cx"> ("urn:ietf:params:xml:ns:caldav" , "calendar-user-type") :
</span><del>- ("", cuTypeConverter, "Calendar User Type",
- caldavxml.CalendarUserType),
</del><ins>+ ("", cuTypeConverter, "Calendar User Type", caldavxml.CalendarUserType),
</ins><span class="cx"> ("urn:ietf:params:xml:ns:caldav" , "calendar-user-address-set") :
</span><del>- ("", cuAddressConverter, "Calendar User Address Set",
- caldavxml.CalendarUserAddressSet),
</del><ins>+ ("", cuAddressConverter, "Calendar User Address Set", caldavxml.CalendarUserAddressSet),
</ins><span class="cx"> (_cs_ns, "first-name") :
</span><span class="cx"> ("firstName", None, "First Name", customxml.FirstNameProperty),
</span><span class="cx"> (_cs_ns, "last-name") :
</span><span class="cx"> ("lastName", None, "Last Name", customxml.LastNameProperty),
</span><span class="cx"> (_cs_ns, "email-address-set") :
</span><del>- ("emailAddresses", None, "Email Addresses",
- customxml.EmailAddressSet),
</del><ins>+ ("emailAddresses", None, "Email Addresses", customxml.EmailAddressSet),
</ins><span class="cx"> }
</span><span class="cx"> _fieldList = [v for _ignore_k, v in sorted(_fieldMap.iteritems(), key=lambda x:x[0])]
</span><span class="cx">
</span><span class="lines">@@ -342,8 +341,10 @@
</span><span class="cx"> else:
</span><span class="cx"> port = int(netloc[1])
</span><span class="cx">
</span><del>- if (host != config.ServerHostName and
- host not in config.Scheduling.Options.PrincipalHostAliases):
</del><ins>+ if (
+ host != config.ServerHostName and
+ host not in config.Scheduling.Options.PrincipalHostAliases
+ ):
</ins><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="cx"> if port != {
</span><span class="lines">@@ -1057,7 +1058,8 @@
</span><span class="cx"> relatives.add(found)
</span><span class="cx">
</span><span class="cx"> if infinity:
</span><del>- yield self._getRelatives(method, relative, relatives, records,
</del><ins>+ yield self._getRelatives(
+ method, relative, relatives, records,
</ins><span class="cx"> infinity=infinity)
</span><span class="cx">
</span><span class="cx"> returnValue(relatives)
</span><span class="lines">@@ -1416,7 +1418,7 @@
</span><span class="cx"> if config.EnableProxyPrincipals and name in (
</span><span class="cx"> "calendar-proxy-read", "calendar-proxy-write",
</span><span class="cx"> "calendar-proxy-read-for", "calendar-proxy-write-for",
</span><del>- ):
</del><ins>+ ):
</ins><span class="cx"> # name is required to be str
</span><span class="cx"> from twistedcaldav.directory.calendaruserproxy import (
</span><span class="cx"> CalendarUserProxyPrincipalResource
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectorytesttest_digestpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_digest.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directory/test/test_digest.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_digest.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -52,36 +52,61 @@
</span><span class="cx">
</span><span class="cx"> challengeNonce = '178288758716122392881254770685'
</span><span class="cx">
</span><del>-challengeResponse = ('digest',
- {'nonce': challengeNonce,
- 'qop': 'auth', 'realm': 'test realm',
- 'algorithm': 'md5', })
</del><ins>+challengeResponse = (
+ 'digest',
+ {
+ 'nonce': challengeNonce,
+ 'qop': 'auth',
+ 'realm': 'test realm',
+ 'algorithm': 'md5',
+ }
+)
</ins><span class="cx">
</span><span class="cx"> cnonce = "29fc54aa1641c6fa0e151419361c8f23"
</span><span class="cx">
</span><del>-authRequest1 = (('username="username", realm="test realm", nonce="%s", '
- 'uri="/write/", response="%s", algorithm="md5", '
- 'cnonce="29fc54aa1641c6fa0e151419361c8f23", nc=00000001, '
- 'qop="auth"'),
- ('username="username", realm="test realm", nonce="%s", '
- 'uri="/write/", response="%s", algorithm="md5"'))
</del><ins>+authRequest1 = (
+ (
+ 'username="username", realm="test realm", nonce="%s", '
+ 'uri="/write/", response="%s", algorithm="md5", '
+ 'cnonce="29fc54aa1641c6fa0e151419361c8f23", nc=00000001, '
+ 'qop="auth"'
+ ),
+ (
+ 'username="username", realm="test realm", nonce="%s", '
+ 'uri="/write/", response="%s", algorithm="md5"'
+ )
+)
</ins><span class="cx">
</span><del>-authRequest2 = (('username="username", realm="test realm", nonce="%s", '
- 'uri="/write/", response="%s", algorithm="md5", '
- 'cnonce="29fc54aa1641c6fa0e151419361c8f23", nc=00000002, '
- 'qop="auth"'),
- ('username="username", realm="test realm", nonce="%s", '
- 'uri="/write/", response="%s", algorithm="md5"'))
</del><ins>+authRequest2 = (
+ (
+ 'username="username", realm="test realm", nonce="%s", '
+ 'uri="/write/", response="%s", algorithm="md5", '
+ 'cnonce="29fc54aa1641c6fa0e151419361c8f23", nc=00000002, '
+ 'qop="auth"'
+ ),
+ (
+ 'username="username", realm="test realm", nonce="%s", '
+ 'uri="/write/", response="%s", algorithm="md5"'
+ )
+)
</ins><span class="cx">
</span><del>-authRequest3 = ('username="username", realm="test realm", nonce="%s", '
- 'uri="/write/", response="%s", algorithm="md5"')
</del><ins>+authRequest3 = (
+ 'username="username", realm="test realm", nonce="%s", '
+ 'uri="/write/", response="%s", algorithm="md5"'
+)
</ins><span class="cx">
</span><del>-authRequestComma = (('username="user,name", realm="test realm", nonce="%s", '
- 'uri="/write/1,2.txt", response="%s", algorithm="md5", '
- 'cnonce="29fc54aa1641c6fa0e151419361c8f23", nc=00000001, '
- 'qop="auth"'),
- ('username="user,name", realm="test realm", nonce="%s", '
- 'uri="/write/1,2.txt", response="%s", algorithm="md5"'))
</del><ins>+authRequestComma = (
+ (
+ 'username="user,name", realm="test realm", nonce="%s", '
+ 'uri="/write/1,2.txt", response="%s", algorithm="md5", '
+ 'cnonce="29fc54aa1641c6fa0e151419361c8f23", nc=00000001, '
+ 'qop="auth"'
+ ),
+ (
+ 'username="user,name", realm="test realm", nonce="%s", '
+ 'uri="/write/1,2.txt", response="%s", algorithm="md5"'
+ )
+)
</ins><span class="cx">
</span><span class="cx"> namelessAuthRequest = 'realm="test realm",nonce="doesn\'t matter"'
</span><span class="cx">
</span><span class="lines">@@ -103,18 +128,20 @@
</span><span class="cx"> self.namespace1 = "DIGEST1"
</span><span class="cx"> self.namespace2 = "DIGEST2"
</span><span class="cx">
</span><del>- self.credentialFactories = (QopDigestCredentialFactory(
- 'md5',
- 'auth',
- 'test realm',
- self.namespace1
- ),
- QopDigestCredentialFactory(
- 'md5',
- '',
- 'test realm',
- self.namespace2
- ))
</del><ins>+ self.credentialFactories = (
+ QopDigestCredentialFactory(
+ 'md5',
+ 'auth',
+ 'test realm',
+ self.namespace1
+ ),
+ QopDigestCredentialFactory(
+ 'md5',
+ '',
+ 'test realm',
+ self.namespace2
+ )
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def getDigestResponse(self, challenge, ncount):
</span><span class="lines">@@ -127,24 +154,28 @@
</span><span class="cx">
</span><span class="cx"> if qop:
</span><span class="cx"> expected = digest.calcResponse(
</span><del>- digest.calcHA1(algo,
- "username",
- "test realm",
- "password",
- nonce,
- cnonce),
</del><ins>+ digest.calcHA1(
+ algo,
+ "username",
+ "test realm",
+ "password",
+ nonce,
+ cnonce
+ ),
</ins><span class="cx"> algo, nonce, ncount, cnonce, qop, "GET", "/write/", None
</span><del>- )
</del><ins>+ )
</ins><span class="cx"> else:
</span><span class="cx"> expected = digest.calcResponse(
</span><del>- digest.calcHA1(algo,
- "username",
- "test realm",
- "password",
- nonce,
- cnonce),
</del><ins>+ digest.calcHA1(
+ algo,
+ "username",
+ "test realm",
+ "password",
+ nonce,
+ cnonce
+ ),
</ins><span class="cx"> algo, nonce, None, None, None, "GET", "/write/", None
</span><del>- )
</del><ins>+ )
</ins><span class="cx"> return expected
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -158,24 +189,28 @@
</span><span class="cx">
</span><span class="cx"> if qop:
</span><span class="cx"> expected = digest.calcResponse(
</span><del>- digest.calcHA1(algo,
- "user,name",
- "test realm",
- "password",
- nonce,
- cnonce),
</del><ins>+ digest.calcHA1(
+ algo,
+ "user,name",
+ "test realm",
+ "password",
+ nonce,
+ cnonce
+ ),
</ins><span class="cx"> algo, nonce, ncount, cnonce, qop, "GET", "/write/1,2.txt", None
</span><del>- )
</del><ins>+ )
</ins><span class="cx"> else:
</span><span class="cx"> expected = digest.calcResponse(
</span><del>- digest.calcHA1(algo,
- "user,name",
- "test realm",
- "password",
- nonce,
- cnonce),
</del><ins>+ digest.calcHA1(
+ algo,
+ "user,name",
+ "test realm",
+ "password",
+ nonce,
+ cnonce
+ ),
</ins><span class="cx"> algo, nonce, None, None, None, "GET", "/write/1,2.txt", None
</span><del>- )
</del><ins>+ )
</ins><span class="cx"> return expected
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -276,8 +311,10 @@
</span><span class="cx"> self.getDigestResponse(challenge, "00000001"),
</span><span class="cx"> )
</span><span class="cx">
</span><del>- creds = (yield factory.decode(clientResponse,
- SimpleRequest(None, 'POST', '/')))
</del><ins>+ creds = (yield factory.decode(
+ clientResponse,
+ SimpleRequest(None, 'POST', '/')
+ ))
</ins><span class="cx"> self.failIf(creds.checkPassword('password'))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -290,17 +327,21 @@
</span><span class="cx">
</span><span class="cx"> # Check for no username
</span><span class="cx"> for factory in self.credentialFactories:
</span><del>- e = (yield self.assertRaisesDeferred(error.LoginFailed,
- factory.decode,
- namelessAuthRequest,
- _trivial_GET()))
</del><ins>+ e = (yield self.assertRaisesDeferred(
+ error.LoginFailed,
+ factory.decode,
+ namelessAuthRequest,
+ _trivial_GET()
+ ))
</ins><span class="cx"> self.assertEquals(str(e), "Invalid response, no username given.")
</span><span class="cx">
</span><span class="cx"> # Check for an empty username
</span><del>- e = (yield self.assertRaisesDeferred(error.LoginFailed,
- factory.decode,
- namelessAuthRequest + ',username=""',
- _trivial_GET()))
</del><ins>+ e = (yield self.assertRaisesDeferred(
+ error.LoginFailed,
+ factory.decode,
+ namelessAuthRequest + ',username=""',
+ _trivial_GET()
+ ))
</ins><span class="cx"> self.assertEquals(str(e), "Invalid response, no username given.")
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -311,10 +352,12 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> for factory in self.credentialFactories:
</span><del>- e = (yield self.assertRaisesDeferred(error.LoginFailed,
- factory.decode,
- 'realm="Test",username="Foo",opaque="bar"',
- _trivial_GET()))
</del><ins>+ e = (yield self.assertRaisesDeferred(
+ error.LoginFailed,
+ factory.decode,
+ 'realm="Test",username="Foo",opaque="bar"',
+ _trivial_GET()
+ ))
</ins><span class="cx"> self.assertEquals(str(e), "Invalid response, no nonce given.")
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -327,10 +370,12 @@
</span><span class="cx">
</span><span class="cx"> # Check for no username
</span><span class="cx"> for factory in self.credentialFactories:
</span><del>- e = (yield self.assertRaisesDeferred(error.LoginFailed,
- factory.decode,
- emtpyAttributeAuthRequest,
- _trivial_GET()))
</del><ins>+ e = (yield self.assertRaisesDeferred(
+ error.LoginFailed,
+ factory.decode,
+ emtpyAttributeAuthRequest,
+ _trivial_GET()
+ ))
</ins><span class="cx"> self.assertEquals(str(e), "Invalid response, no username given.")
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -352,10 +397,10 @@
</span><span class="cx"> creds = (yield factory.decode(clientResponse, _trivial_GET()))
</span><span class="cx">
</span><span class="cx"> self.failUnless(creds.checkHash(
</span><del>- md5('username:test realm:password').hexdigest()))
</del><ins>+ md5('username:test realm:password').hexdigest()))
</ins><span class="cx">
</span><span class="cx"> self.failIf(creds.checkHash(
</span><del>- md5('username:test realm:bogus').hexdigest()))
</del><ins>+ md5('username:test realm:bogus').hexdigest()))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -500,7 +545,7 @@
</span><span class="cx"> ("user", "realm", "password", "preHA1"),
</span><span class="cx"> (None, "realm", None, "preHA1"),
</span><span class="cx"> (None, None, "password", "preHA1"),
</span><del>- )
</del><ins>+ )
</ins><span class="cx">
</span><span class="cx"> for pszUsername, pszRealm, pszPassword, preHA1 in arguments:
</span><span class="cx"> self.assertRaises(
</span><span class="lines">@@ -513,7 +558,7 @@
</span><span class="cx"> "nonce",
</span><span class="cx"> "cnonce",
</span><span class="cx"> preHA1=preHA1
</span><del>- )
</del><ins>+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectorytesttest_principalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_principal.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directory/test/test_principal.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_principal.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> self.assertEquals(shortNames, set(expected))
</span><span class="cx">
</span><span class="cx"> for shortName in shortNames:
</span><del>- #print(" -> %s" % (shortName,))
</del><ins>+ # print(" -> %s" % (shortName,))
</ins><span class="cx"> recordResource = yield typeResource.getChild(shortName)
</span><span class="cx"> self.failUnless(
</span><span class="cx"> isinstance(recordResource, DirectoryPrincipalResource)
</span><span class="lines">@@ -861,7 +861,7 @@
</span><span class="cx"> yield self._checkPrivileges(*args)
</span><span class="cx">
</span><span class="cx"> for recordType in (yield provisioningResource.listChildren()):
</span><del>- #print(" -> %s" % (recordType,))
</del><ins>+ # print(" -> %s" % (recordType,))
</ins><span class="cx"> typeResource = yield provisioningResource.getChild(recordType)
</span><span class="cx">
</span><span class="cx"> for args in (
</span><span class="lines">@@ -992,7 +992,7 @@
</span><span class="cx"> if allowed:
</span><span class="cx"> def onError(f):
</span><span class="cx"> f.trap(AccessDeniedError)
</span><del>- #print(resource.readDeadProperty(davxml.ACL))
</del><ins>+ # print(resource.readDeadProperty(davxml.ACL))
</ins><span class="cx"> self.fail(
</span><span class="cx"> "%s should have %s privilege on %r"
</span><span class="cx"> % (principal.sname(), privilege.sname(), resource)
</span><span class="lines">@@ -1003,7 +1003,7 @@
</span><span class="cx"> f.trap(AccessDeniedError)
</span><span class="cx">
</span><span class="cx"> def onSuccess(_):
</span><del>- #print(resource.readDeadProperty(davxml.ACL))
</del><ins>+ # print(resource.readDeadProperty(davxml.ACL))
</ins><span class="cx"> self.fail(
</span><span class="cx"> "%s should not have %s privilege on %r"
</span><span class="cx"> % (principal.sname(), privilege.sname(), resource)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectorytesttest_proxyprincipaldbpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -334,7 +334,6 @@
</span><span class="cx"> yield db.clean()
</span><span class="cx">
</span><span class="cx">
</span><del>-
</del><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_cachingDBInsertUncached(self):
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectorybackedaddressbookpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -102,10 +102,10 @@
</span><span class="cx"> davxml.Grant(
</span><span class="cx"> davxml.Privilege(davxml.Read()),
</span><span class="cx"> davxml.Privilege(davxml.ReadCurrentUserPrivilegeSet())
</span><del>- ),
</del><ins>+ ),
</ins><span class="cx"> davxml.Protected(),
</span><span class="cx"> TwistedACLInheritable(),
</span><del>- ),
</del><ins>+ ),
</ins><span class="cx"> )
</span><span class="cx"> )
</span><span class="cx">
</span><span class="lines">@@ -174,9 +174,9 @@
</span><span class="cx"> "EMAIL": FieldName.emailAddresses,
</span><span class="cx"> "UID": FieldName.uid,
</span><span class="cx"> "ADR": (
</span><del>- CalFieldName.streetAddress,
- CalFieldName.floor,
- ),
</del><ins>+ CalFieldName.streetAddress,
+ CalFieldName.floor,
+ ),
</ins><span class="cx"> "KIND": FieldName.recordType,
</span><span class="cx"> # LATER "X-ADDRESSBOOKSERVER-MEMBER": FieldName.membersUIDs,
</span><span class="cx"> }
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx"> else:
</span><span class="cx"> log.debug("doAddressBookDirectoryQuery: vCard did not match filter:\n{vcard}", vcard=vCardResult.vCard())
</span><span class="cx">
</span><del>- #no more results
</del><ins>+ # no more results
</ins><span class="cx"> if not queryLimited:
</span><span class="cx"> break
</span><span class="cx">
</span><span class="lines">@@ -338,20 +338,20 @@
</span><span class="cx"> if addedExpressions is True:
</span><span class="cx"> if not allOf:
</span><span class="cx"> expressionList = True # expressionList or True is True
</span><del>- #else expressionList and True is expressionList
</del><ins>+ # else expressionList and True is expressionList
</ins><span class="cx"> elif addedExpressions is False:
</span><span class="cx"> if allOf:
</span><span class="cx"> expressionList = False # expressionList and False is False
</span><del>- #else expressionList or False is expressionList
</del><ins>+ # else expressionList or False is expressionList
</ins><span class="cx"> else:
</span><span class="cx"> if expressionList is False:
</span><span class="cx"> if not allOf:
</span><span class="cx"> expressionList = addedExpressions # False or addedExpressions is addedExpressions
</span><del>- #else False and addedExpressions is False
</del><ins>+ # else False and addedExpressions is False
</ins><span class="cx"> elif expressionList is True:
</span><span class="cx"> if allOf:
</span><span class="cx"> expressionList = addedExpressions # False or addedExpressions is addedExpressions
</span><del>- #else False and addedExpressions is False
</del><ins>+ # else False and addedExpressions is False
</ins><span class="cx"> else:
</span><span class="cx"> expressionList.extend(addedExpressions)
</span><span class="cx"> return expressionList
</span><span class="lines">@@ -432,7 +432,7 @@
</span><span class="cx"> rawString = matchString
</span><span class="cx"> matchString = ""
</span><span class="cx"> for c in rawString:
</span><del>- if not c in "TZ-:":
</del><ins>+ if c not in "TZ-:":
</ins><span class="cx"> matchString += c
</span><span class="cx"> elif propFilter.filter_name == "GEO":
</span><span class="cx"> matchString = ",".join(matchString.split(";"))
</span><span class="lines">@@ -440,10 +440,10 @@
</span><span class="cx"> if propFilter.filter_name in ("N" , "ADR", "ORG",):
</span><span class="cx"> # for structured properties, change into multiple strings for ds query
</span><span class="cx"> if propFilter.filter_name == "ADR":
</span><del>- #split by newline and comma
</del><ins>+ # split by newline and comma
</ins><span class="cx"> rawStrings = ",".join(matchString.split("\n")).split(",")
</span><span class="cx"> else:
</span><del>- #split by space
</del><ins>+ # split by space
</ins><span class="cx"> rawStrings = matchString.split(" ")
</span><span class="cx">
</span><span class="cx"> # remove empty strings
</span><span class="lines">@@ -460,7 +460,7 @@
</span><span class="cx"> # end getMatchStrings
</span><span class="cx">
</span><span class="cx"> if constant:
</span><del>- #FIXME: match is not implemented in twisteddaldav.query.Filter.TextMatch so use _match for now
</del><ins>+ # FIXME: match is not implemented in twisteddaldav.query.Filter.TextMatch so use _match for now
</ins><span class="cx"> return textMatchElement._match([constant, ])
</span><span class="cx"> else:
</span><span class="cx">
</span><span class="lines">@@ -502,7 +502,7 @@
</span><span class="cx">
</span><span class="cx"> # attribute exists search
</span><span class="cx"> return definedExpression(True, propFilterAllOf)
</span><del>- #end textMatchElementExpression()
</del><ins>+ # end textMatchElementExpression()
</ins><span class="cx">
</span><span class="cx"> # searchablePropFilterAttrNames are attributes to be used by this propfilter's expression
</span><span class="cx"> searchableFields = vcardPropToSearchableFieldMap.get(propFilter.filter_name, [])
</span><span class="lines">@@ -515,7 +515,7 @@
</span><span class="cx"> # return None to try to match all items if this is the only property filter
</span><span class="cx"> return None
</span><span class="cx">
</span><del>- #create a textMatchElement for the IsNotDefined qualifier
</del><ins>+ # create a textMatchElement for the IsNotDefined qualifier
</ins><span class="cx"> if isinstance(propFilter.qualifier, IsNotDefined):
</span><span class="cx"> textMatchElement = TextMatch(carddavxml.TextMatch.fromString(""))
</span><span class="cx"> textMatchElement.negate = True
</span><span class="lines">@@ -544,7 +544,7 @@
</span><span class="cx"> propFilterExpressions = [CompoundExpression(propFilterExpressions, Operand.AND if propFilterAllOf else Operand.OR)]
</span><span class="cx">
</span><span class="cx"> return propFilterExpressions
</span><del>- #end propFilterExpression
</del><ins>+ # end propFilterExpression
</ins><span class="cx">
</span><span class="cx"> expressions = None
</span><span class="cx"> for propFilter in propFilters:
</span><span class="lines">@@ -586,7 +586,7 @@
</span><span class="cx"> else:
</span><span class="cx"> expression = not filterAllOf
</span><span class="cx">
</span><del>- #log.debug("expressionFromABFilter: expression={q!r}, properties={pn}", q=expression, pn=properties)
</del><ins>+ # log.debug("expressionFromABFilter: expression={q!r}, properties={pn}", q=expression, pn=properties)
</ins><span class="cx"> return((properties, expression))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -599,7 +599,7 @@
</span><span class="cx"> def __init__(self, directoryBackedAddressBook,):
</span><span class="cx">
</span><span class="cx"> self._directoryBackedAddressBook = directoryBackedAddressBook
</span><del>- #self._vCard = None
</del><ins>+ # self._vCard = None
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def __repr__(self):
</span><span class="lines">@@ -637,7 +637,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def hRef(self, parentURI=None):
</span><del>- return davxml.HRef.fromString(joinURL(parentURI if parentURI else self._directoryBackedAddressBook.uri, self.uri()))
</del><ins>+ return davxml.HRef.fromString(joinURL(parentURI if parentURI else self._directoryBackedAddressBook.uri, self.uri()))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def readProperty(self, property, request):
</span><span class="lines">@@ -668,7 +668,7 @@
</span><span class="cx"> else:
</span><span class="cx"> modDatetime = datetime.datetime.utcnow()
</span><span class="cx">
</span><del>- #strip time zone because time zones are unimplemented in davxml.GETLastModified.fromDate
</del><ins>+ # strip time zone because time zones are unimplemented in davxml.GETLastModified.fromDate
</ins><span class="cx"> d = modDatetime.date()
</span><span class="cx"> t = modDatetime.time()
</span><span class="cx"> modDatetimeNoTZ = datetime.datetime(d.year, d.month, d.day, t.hour, t.minute, t.second, t.microsecond, None)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavextensionspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/extensions.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/extensions.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/extensions.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -76,8 +76,10 @@
</span><span class="cx"> class DirectoryPrincipalPropertySearchMixIn(object):
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>- def report_DAV__principal_property_search(self, request,
- principal_property_search):
</del><ins>+ def report_DAV__principal_property_search(
+ self, request,
+ principal_property_search
+ ):
</ins><span class="cx"> """
</span><span class="cx"> Generate a principal-property-search REPORT. (RFC 3744, section 9.4)
</span><span class="cx"> Overrides twisted implementation, targeting only directory-enabled
</span><span class="lines">@@ -123,8 +125,10 @@
</span><span class="cx"> propertiesForResource = prop_common.propertyListForResource
</span><span class="cx"> propElement = child
</span><span class="cx">
</span><del>- elif child.qname() == (dav_namespace,
- "apply-to-principal-collection-set"):
</del><ins>+ elif child.qname() == (
+ dav_namespace,
+ "apply-to-principal-collection-set"
+ ):
</ins><span class="cx"> applyTo = True
</span><span class="cx">
</span><span class="cx"> elif child.qname() == (dav_namespace, "property-search"):
</span><span class="lines">@@ -203,8 +207,10 @@
</span><span class="cx"> else:
</span><span class="cx"> nonDirectoryProps.append(prop)
</span><span class="cx"> if nonDirectoryProps:
</span><del>- nonDirectorySearches.append((nonDirectoryProps, match,
- matchFlags, matchType))
</del><ins>+ nonDirectorySearches.append((
+ nonDirectoryProps, match,
+ matchFlags, matchType
+ ))
</ins><span class="cx">
</span><span class="cx"> matchingResources = []
</span><span class="cx"> matchcount = 0
</span><span class="lines">@@ -212,8 +218,10 @@
</span><span class="cx"> # nonDirectorySearches are ignored
</span><span class="cx"> if fields:
</span><span class="cx">
</span><del>- records = (yield dir.recordsMatchingFieldsWithCUType(fields,
- operand=operand, cuType=cuType))
</del><ins>+ records = (yield dir.recordsMatchingFieldsWithCUType(
+ fields,
+ operand=operand, cuType=cuType
+ ))
</ins><span class="cx">
</span><span class="cx"> for record in records:
</span><span class="cx"> resource = yield principalCollection.principalForRecord(record)
</span><span class="lines">@@ -251,15 +259,19 @@
</span><span class="cx"> responsecode.INSUFFICIENT_STORAGE_SPACE
</span><span class="cx"> ),
</span><span class="cx"> element.Error(element.NumberOfMatchesWithinLimits()),
</span><del>- element.ResponseDescription("Results limited by %s at %d"
- % resultsWereLimited),
</del><ins>+ element.ResponseDescription(
+ "Results limited by %s at %d"
+ % resultsWereLimited
+ ),
</ins><span class="cx"> ))
</span><span class="cx"> returnValue(MultiStatusResponse(responses))
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>- def report_http___calendarserver_org_ns__calendarserver_principal_search(self, request,
- calendarserver_principal_search):
</del><ins>+ def report_http___calendarserver_org_ns__calendarserver_principal_search(
+ self, request,
+ calendarserver_principal_search
+ ):
</ins><span class="cx"> """
</span><span class="cx"> Generate a calendarserver-principal-search REPORT.
</span><span class="cx">
</span><span class="lines">@@ -282,8 +294,10 @@
</span><span class="cx"> tokens, context, applyTo, clientLimit, propElement = extractCalendarServerPrincipalSearchData(calendarserver_principal_search)
</span><span class="cx">
</span><span class="cx"> if not validateTokens(tokens):
</span><del>- raise HTTPError(StatusResponse(responsecode.FORBIDDEN,
- "Insufficient search token length"))
</del><ins>+ raise HTTPError(StatusResponse(
+ responsecode.FORBIDDEN,
+ "Insufficient search token length"
+ ))
</ins><span class="cx">
</span><span class="cx"> # Run report
</span><span class="cx"> resultsWereLimited = None
</span><span class="lines">@@ -342,8 +356,10 @@
</span><span class="cx"> responsecode.INSUFFICIENT_STORAGE_SPACE
</span><span class="cx"> ),
</span><span class="cx"> element.Error(element.NumberOfMatchesWithinLimits()),
</span><del>- element.ResponseDescription("Results limited by %s at %d"
- % resultsWereLimited),
</del><ins>+ element.ResponseDescription(
+ "Results limited by %s at %d"
+ % resultsWereLimited
+ ),
</ins><span class="cx"> ))
</span><span class="cx"> returnValue(MultiStatusResponse(responses))
</span><span class="cx">
</span><span class="lines">@@ -868,7 +884,8 @@
</span><span class="cx">
</span><span class="cx"> class PropertyNotFoundError (HTTPError):
</span><span class="cx"> def __init__(self, qname):
</span><del>- HTTPError.__init__(self,
</del><ins>+ HTTPError.__init__(
+ self,
</ins><span class="cx"> StatusResponse(
</span><span class="cx"> responsecode.NOT_FOUND,
</span><span class="cx"> "No such property: %s" % encodeXMLName(*qname)
</span><span class="lines">@@ -890,7 +907,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def get(self, qname, uid=None):
</span><del>- #self.log.debug("Get: %r, %r" % (self.resource.fp.path, qname))
</del><ins>+ # self.log.debug("Get: %r, %r" % (self.resource.fp.path, qname))
</ins><span class="cx">
</span><span class="cx"> cache = self._cache()
</span><span class="cx">
</span><span class="lines">@@ -913,7 +930,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def set(self, property, uid=None):
</span><del>- #self.log.debug("Set: %r, %r" % (self.resource.fp.path, property))
</del><ins>+ # self.log.debug("Set: %r, %r" % (self.resource.fp.path, property))
</ins><span class="cx">
</span><span class="cx"> cache = self._cache()
</span><span class="cx">
</span><span class="lines">@@ -925,7 +942,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def contains(self, qname, uid=None):
</span><del>- #self.log.debug("Contains: %r, %r" % (self.resource.fp.path, qname))
</del><ins>+ # self.log.debug("Contains: %r, %r" % (self.resource.fp.path, qname))
</ins><span class="cx">
</span><span class="cx"> cachedQname = qname + (uid,)
</span><span class="cx">
</span><span class="lines">@@ -938,14 +955,14 @@
</span><span class="cx"> raise
</span><span class="cx">
</span><span class="cx"> if cachedQname in cache:
</span><del>- #self.log.debug("Contains cache hit: %r, %r, %r" % (self, self.resource.fp.path, qname))
</del><ins>+ # self.log.debug("Contains cache hit: %r, %r, %r" % (self, self.resource.fp.path, qname))
</ins><span class="cx"> return True
</span><span class="cx"> else:
</span><span class="cx"> return False
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def delete(self, qname, uid=None):
</span><del>- #self.log.debug("Delete: %r, %r" % (self.resource.fp.path, qname))
</del><ins>+ # self.log.debug("Delete: %r, %r" % (self.resource.fp.path, qname))
</ins><span class="cx">
</span><span class="cx"> cachedQname = qname + (uid,)
</span><span class="cx">
</span><span class="lines">@@ -956,7 +973,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def list(self, uid=None, filterByUID=True):
</span><del>- #self.log.debug("List: %r" % (self.resource.fp.path,))
</del><ins>+ # self.log.debug("List: %r" % (self.resource.fp.path,))
</ins><span class="cx"> keys = self._cache().iterkeys()
</span><span class="cx"> if filterByUID:
</span><span class="cx"> return [
</span><span class="lines">@@ -970,7 +987,7 @@
</span><span class="cx">
</span><span class="cx"> def _cache(self):
</span><span class="cx"> if not hasattr(self, "_data"):
</span><del>- #self.log.debug("Cache init: %r" % (self.resource.fp.path,))
</del><ins>+ # self.log.debug("Cache init: %r" % (self.resource.fp.path,))
</ins><span class="cx"> self._data = dict(
</span><span class="cx"> (name, None)
</span><span class="cx"> for name in self.propertyStore.list(filterByUID=False)
</span><span class="lines">@@ -999,8 +1016,10 @@
</span><span class="cx"> if child.qname() == (dav_namespace, "prop"):
</span><span class="cx"> propElement = child
</span><span class="cx">
</span><del>- elif child.qname() == (dav_namespace,
- "apply-to-principal-collection-set"):
</del><ins>+ elif child.qname() == (
+ dav_namespace,
+ "apply-to-principal-collection-set"
+ ):
</ins><span class="cx"> applyTo = True
</span><span class="cx">
</span><span class="cx"> elif child.qname() == (calendarserver_namespace, "search-token"):
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavinstancepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/instance.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/instance.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/instance.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> self._addMasterToDoComponent(component, lowerLimit, limit)
</span><span class="cx"> master = component
</span><span class="cx"> elif component.name() == "VJOURNAL":
</span><del>- #TODO: VJOURNAL
</del><ins>+ # TODO: VJOURNAL
</ins><span class="cx"> raise NotImplementedError("VJOURNAL recurrence expansion not supported yet")
</span><span class="cx"> elif component.name() == "VFREEBUSY":
</span><span class="cx"> self._addFreeBusyComponent(component, lowerLimit, limit)
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> elif component.name() == "VTODO":
</span><span class="cx"> self._addOverrideToDoComponent(component, lowerLimit, limit, master)
</span><span class="cx"> elif component.name() == "VJOURNAL":
</span><del>- #TODO: VJOURNAL
</del><ins>+ # TODO: VJOURNAL
</ins><span class="cx"> raise NotImplementedError("VJOURNAL recurrence expansion not supported yet")
</span><span class="cx"> elif component.name() == "AVAILABLE":
</span><span class="cx"> # AVAILABLE components are just like VEVENT components
</span><span class="lines">@@ -268,7 +268,7 @@
</span><span class="cx"> @param master: the master component which has already been expanded, or C{None}.
</span><span class="cx"> """
</span><span class="cx">
</span><del>- #TODO: This does not take into account THISANDPRIOR - only THISANDFUTURE
</del><ins>+ # TODO: This does not take into account THISANDPRIOR - only THISANDFUTURE
</ins><span class="cx">
</span><span class="cx"> details = self._getMasterEventDetails(component)
</span><span class="cx"> if details is None:
</span><span class="lines">@@ -349,7 +349,7 @@
</span><span class="cx"> @param master: the master component which has already been expanded, or C{None}.
</span><span class="cx"> """
</span><span class="cx">
</span><del>- #TODO: This does not take into account THISANDPRIOR - only THISANDFUTURE
</del><ins>+ # TODO: This does not take into account THISANDPRIOR - only THISANDFUTURE
</ins><span class="cx">
</span><span class="cx"> details = self._getMasterToDoDetails(component)
</span><span class="cx"> if details is None:
</span><span class="lines">@@ -369,8 +369,11 @@
</span><span class="cx"> # Begin expansion far in the past because there may be RDATEs earlier
</span><span class="cx"> # than the master DTSTART, and if we exclude those, the associated
</span><span class="cx"> # overridden instances will cause an InvalidOverriddenInstance.
</span><del>- limited = rrules.expand(rulestart,
- Period(DateTime(1900, 1, 1), upperlimit), expanded)
</del><ins>+ limited = rrules.expand(
+ rulestart,
+ Period(DateTime(1900, 1, 1), upperlimit),
+ expanded
+ )
</ins><span class="cx"> for startDate in expanded:
</span><span class="cx"> startDate = self.normalizeFunction(startDate)
</span><span class="cx"> endDate = startDate + duration
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavlocalizationpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/localization.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/localization.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/localization.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -120,7 +120,8 @@
</span><span class="cx"> key = (lang, domain, localeDir)
</span><span class="cx"> self.translation = self.translations.get(key, None)
</span><span class="cx"> if self.translation is None:
</span><del>- self.translation = gettext.translation(domain=domain,
</del><ins>+ self.translation = gettext.translation(
+ domain=domain,
</ins><span class="cx"> localedir=localeDir, languages=[lang, 'en'], fallback=True)
</span><span class="cx"> self.translations[key] = self.translation
</span><span class="cx">
</span><span class="lines">@@ -208,9 +209,11 @@
</span><span class="cx"> return (
</span><span class="cx"> _("%(startTime)s to %(endTime)s")
</span><span class="cx"> % {
</span><del>- 'startTime' : self.dtTime(dtStart,
- includeTimezone=(tzStart != tzEnd)),
- 'endTime' : self.dtTime(dtEnd),
</del><ins>+ 'startTime' : self.dtTime(
+ dtStart,
+ includeTimezone=(tzStart != tzEnd)
+ ),
+ 'endTime' : self.dtTime(dtEnd),
</ins><span class="cx"> },
</span><span class="cx"> self.dtDuration(duration)
</span><span class="cx"> )
</span><span class="lines">@@ -271,8 +274,10 @@
</span><span class="cx"> if days == 1:
</span><span class="cx"> parts.append(_("1 day"))
</span><span class="cx"> elif days > 1:
</span><del>- parts.append(_("%(dayCount)d days") %
- {'dayCount' : days})
</del><ins>+ parts.append(
+ _("%(dayCount)d days") %
+ {'dayCount' : days}
+ )
</ins><span class="cx">
</span><span class="cx"> hours = divmod(total / 3600, 24)[1]
</span><span class="cx"> minutes = divmod(total / 60, 60)[1]
</span><span class="lines">@@ -281,20 +286,26 @@
</span><span class="cx"> if hours == 1:
</span><span class="cx"> parts.append(_("1 hour"))
</span><span class="cx"> elif hours > 1:
</span><del>- parts.append(_("%(hourCount)d hours") %
- {'hourCount' : hours})
</del><ins>+ parts.append(
+ _("%(hourCount)d hours") %
+ {'hourCount' : hours}
+ )
</ins><span class="cx">
</span><span class="cx"> if minutes == 1:
</span><span class="cx"> parts.append(_("1 minute"))
</span><span class="cx"> elif minutes > 1:
</span><del>- parts.append(_("%(minuteCount)d minutes") %
- {'minuteCount' : minutes})
</del><ins>+ parts.append(
+ _("%(minuteCount)d minutes") %
+ {'minuteCount' : minutes}
+ )
</ins><span class="cx">
</span><span class="cx"> if seconds == 1:
</span><span class="cx"> parts.append(_("1 second"))
</span><span class="cx"> elif seconds > 1:
</span><del>- parts.append(_("%(secondCount)d seconds") %
- {'secondCount' : seconds})
</del><ins>+ parts.append(
+ _("%(secondCount)d seconds") %
+ {'secondCount' : seconds}
+ )
</ins><span class="cx">
</span><span class="cx"> return " ".join(parts)
</span><span class="cx">
</span><span class="lines">@@ -380,28 +391,37 @@
</span><span class="cx"> try:
</span><span class="cx"> os.mkdir(gnuRoot)
</span><span class="cx"> except OSError:
</span><del>- log.warn("Could not create gnuttext translation directory: %s"
</del><ins>+ log.warn(
+ "Could not create gnuttext translation directory: %s"
</ins><span class="cx"> % (gnuRoot,))
</span><span class="cx"> return
</span><span class="cx">
</span><span class="cx"> # Scan for Apple translations (directories ending in .lproj)
</span><span class="cx"> for item in os.listdir(lprojRoot):
</span><span class="cx"> if item.endswith(".lproj"):
</span><del>- stringsFile = os.path.join(lprojRoot, item,
- 'calendarserver.strings')
</del><ins>+ stringsFile = os.path.join(
+ lprojRoot, item,
+ 'calendarserver.strings'
+ )
</ins><span class="cx"> localeName = normalize(item[:-6])
</span><del>- moFile = os.path.join(gnuRoot, localeName, 'LC_MESSAGES',
- 'calendarserver.mo')
</del><ins>+ moFile = os.path.join(
+ gnuRoot, localeName, 'LC_MESSAGES',
+ 'calendarserver.mo'
+ )
</ins><span class="cx"> if os.path.exists(stringsFile):
</span><del>- if (not os.path.exists(moFile) or
</del><ins>+ if (
+ not os.path.exists(moFile) or
</ins><span class="cx"> os.stat(stringsFile).st_mtime >
</span><del>- os.stat(moFile).st_mtime):
</del><ins>+ os.stat(moFile).st_mtime
+ ):
</ins><span class="cx"> log.info("Converting %s to %s" % (stringsFile, moFile))
</span><span class="cx"> try:
</span><span class="cx"> convertStringsFile(stringsFile, moFile)
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Failed to convert %s to %s: %s" %
- (stringsFile, moFile, e))
</del><ins>+ log.error(
+ "Failed to convert %s to %s: %s" %
+ (stringsFile, moFile, e)
+ )
</ins><span class="cx"> else:
</span><span class="cx"> log.info("%s is up to date" % (moFile,))
</span><span class="cx">
</span><span class="lines">@@ -447,8 +467,12 @@
</span><span class="cx"> origStr = original.encode("UTF-8")
</span><span class="cx"> transStr = translation.encode("UTF-8")
</span><span class="cx">
</span><del>- descriptors.append((len(keys), len(origStr), len(values),
- len(transStr)))
</del><ins>+ descriptors.append(
+ (
+ len(keys), len(origStr), len(values),
+ len(transStr)
+ )
+ )
</ins><span class="cx"> keys += origStr + '\0' # <NUL> terminated
</span><span class="cx"> values += transStr + '\0'
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavmemcacheclientpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/memcacheclient.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/memcacheclient.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/memcacheclient.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -80,30 +80,36 @@
</span><span class="cx"> from binascii import crc32 # zlib version is not cross-platform
</span><span class="cx"> serverHashFunction = crc32
</span><span class="cx">
</span><del>-__author__ = "Evan Martin <martine@danga.com>"
</del><ins>+__author__ = "Evan Martin <martine@danga.com>"
</ins><span class="cx"> __version__ = "1.44"
</span><span class="cx"> __copyright__ = "Copyright (C) 2003 Danga Interactive"
</span><del>-__license__ = "Python"
</del><ins>+__license__ = "Python"
</ins><span class="cx">
</span><span class="cx"> SERVER_MAX_KEY_LENGTH = 250
</span><span class="cx"> # Storing values larger than 1MB requires recompiling memcached. If you do,
</span><span class="cx"> # this value can be changed by doing "memcacheclient.SERVER_MAX_VALUE_LENGTH = N"
</span><span class="cx"> # after importing this module.
</span><del>-SERVER_MAX_VALUE_LENGTH = 1024*1024
</del><ins>+SERVER_MAX_VALUE_LENGTH = 1024 * 1024
</ins><span class="cx">
</span><span class="cx"> class _Error(Exception):
</span><span class="cx"> pass
</span><span class="cx">
</span><ins>+
+
</ins><span class="cx"> class MemcacheError(_Error):
</span><span class="cx"> """
</span><span class="cx"> Memcache connection error
</span><span class="cx"> """
</span><span class="cx">
</span><ins>+
+
</ins><span class="cx"> class NotFoundError(MemcacheError):
</span><span class="cx"> """
</span><span class="cx"> NOT_FOUND error
</span><span class="cx"> """
</span><span class="cx">
</span><ins>+
+
</ins><span class="cx"> class TokenMismatchError(MemcacheError):
</span><span class="cx"> """
</span><span class="cx"> Check-and-set token mismatch
</span><span class="lines">@@ -117,27 +123,34 @@
</span><span class="cx"> class local(object):
</span><span class="cx"> pass
</span><span class="cx">
</span><ins>+
+
</ins><span class="cx"> class ClientFactory(object):
</span><span class="cx">
</span><span class="cx"> # unit tests should set this to True to enable the fake test cache
</span><span class="cx"> allowTestCache = False
</span><span class="cx">
</span><span class="cx"> @classmethod
</span><del>- def getClient(cls, servers, debug=0, pickleProtocol=0,
- pickler=pickle.Pickler, unpickler=pickle.Unpickler,
- pload=None, pid=None):
</del><ins>+ def getClient(
+ cls, servers, debug=0, pickleProtocol=0,
+ pickler=pickle.Pickler, unpickler=pickle.Unpickler,
+ pload=None, pid=None
+ ):
</ins><span class="cx">
</span><span class="cx"> if cls.allowTestCache:
</span><del>- return TestClient(servers, debug=debug,
</del><ins>+ return TestClient(
+ servers, debug=debug,
</ins><span class="cx"> pickleProtocol=pickleProtocol, pickler=pickler,
</span><span class="cx"> unpickler=unpickler, pload=pload, pid=pid)
</span><span class="cx"> elif config.Memcached.Pools.Default.ClientEnabled:
</span><del>- return Client(servers, debug=debug, pickleProtocol=pickleProtocol,
</del><ins>+ return Client(
+ servers, debug=debug, pickleProtocol=pickleProtocol,
</ins><span class="cx"> pickler=pickler, unpickler=unpickler, pload=pload, pid=pid)
</span><span class="cx"> else:
</span><span class="cx"> return None
</span><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> class Client(local):
</span><span class="cx"> """
</span><span class="cx"> Object representing a pool of memcache servers.
</span><span class="lines">@@ -159,27 +172,38 @@
</span><span class="cx"> @sort: __init__, set_servers, forget_dead_hosts, disconnect_all, debuglog,\
</span><span class="cx"> set, set_multi, add, replace, get, get_multi, incr, decr, delete, delete_multi
</span><span class="cx"> """
</span><del>- _FLAG_PICKLE = 1<<0
- _FLAG_INTEGER = 1<<1
- _FLAG_LONG = 1<<2
- _FLAG_COMPRESSED = 1<<3
</del><ins>+ _FLAG_PICKLE = 1 << 0
+ _FLAG_INTEGER = 1 << 1
+ _FLAG_LONG = 1 << 2
+ _FLAG_COMPRESSED = 1 << 3
</ins><span class="cx">
</span><span class="cx"> _SERVER_RETRIES = 10 # how many times to try finding a free server.
</span><span class="cx">
</span><span class="cx"> # exceptions for Client
</span><span class="cx"> class MemcachedKeyError(Exception):
</span><span class="cx"> pass
</span><ins>+
+
</ins><span class="cx"> class MemcachedKeyLengthError(MemcachedKeyError):
</span><span class="cx"> pass
</span><ins>+
+
</ins><span class="cx"> class MemcachedKeyCharacterError(MemcachedKeyError):
</span><span class="cx"> pass
</span><ins>+
+
</ins><span class="cx"> class MemcachedKeyNoneError(MemcachedKeyError):
</span><span class="cx"> pass
</span><ins>+
+
</ins><span class="cx"> class MemcachedKeyTypeError(MemcachedKeyError):
</span><span class="cx"> pass
</span><ins>+
+
</ins><span class="cx"> class MemcachedStringEncodingError(Exception):
</span><span class="cx"> pass
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def __init__(self, servers, debug=0, pickleProtocol=0,
</span><span class="cx"> pickler=pickle.Pickler, unpickler=pickle.Unpickler,
</span><span class="cx"> pload=None, pid=None):
</span><span class="lines">@@ -212,11 +236,12 @@
</span><span class="cx"> # figure out the pickler style
</span><span class="cx"> file = StringIO()
</span><span class="cx"> try:
</span><del>- pickler = self.pickler(file, protocol = self.pickleProtocol)
</del><ins>+ pickler = self.pickler(file, protocol=self.pickleProtocol)
</ins><span class="cx"> self.picklerIsKeyword = True
</span><span class="cx"> except TypeError:
</span><span class="cx"> self.picklerIsKeyword = False
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def set_servers(self, servers):
</span><span class="cx"> """
</span><span class="cx"> Set the pool of servers used by this client.
</span><span class="lines">@@ -230,6 +255,7 @@
</span><span class="cx"> self.servers = [_Host(s, self.debuglog) for s in servers]
</span><span class="cx"> self._init_buckets()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def get_stats(self):
</span><span class="cx"> '''Get statistics from each of the servers.
</span><span class="cx">
</span><span class="lines">@@ -240,64 +266,74 @@
</span><span class="cx"> '''
</span><span class="cx"> data = []
</span><span class="cx"> for s in self.servers:
</span><del>- if not s.connect(): continue
</del><ins>+ if not s.connect():
+ continue
</ins><span class="cx"> if s.family == socket.AF_INET:
</span><del>- name = '%s:%s (%s)' % ( s.ip, s.port, s.weight )
</del><ins>+ name = '%s:%s (%s)' % (s.ip, s.port, s.weight)
</ins><span class="cx"> else:
</span><del>- name = 'unix:%s (%s)' % ( s.address, s.weight )
</del><ins>+ name = 'unix:%s (%s)' % (s.address, s.weight)
</ins><span class="cx"> s.send_cmd('stats')
</span><span class="cx"> serverData = {}
</span><del>- data.append(( name, serverData ))
</del><ins>+ data.append((name, serverData))
</ins><span class="cx"> readline = s.readline
</span><span class="cx"> while 1:
</span><span class="cx"> line = readline()
</span><del>- if not line or line.strip() == 'END': break
</del><ins>+ if not line or line.strip() == 'END':
+ break
</ins><span class="cx"> stats = line.split(' ', 2)
</span><span class="cx"> serverData[stats[1]] = stats[2]
</span><span class="cx">
</span><span class="cx"> return(data)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def get_slabs(self):
</span><span class="cx"> data = []
</span><span class="cx"> for s in self.servers:
</span><del>- if not s.connect(): continue
</del><ins>+ if not s.connect():
+ continue
</ins><span class="cx"> if s.family == socket.AF_INET:
</span><del>- name = '%s:%s (%s)' % ( s.ip, s.port, s.weight )
</del><ins>+ name = '%s:%s (%s)' % (s.ip, s.port, s.weight)
</ins><span class="cx"> else:
</span><del>- name = 'unix:%s (%s)' % ( s.address, s.weight )
</del><ins>+ name = 'unix:%s (%s)' % (s.address, s.weight)
</ins><span class="cx"> serverData = {}
</span><del>- data.append(( name, serverData ))
</del><ins>+ data.append((name, serverData))
</ins><span class="cx"> s.send_cmd('stats items')
</span><span class="cx"> readline = s.readline
</span><span class="cx"> while 1:
</span><span class="cx"> line = readline()
</span><del>- if not line or line.strip() == 'END': break
</del><ins>+ if not line or line.strip() == 'END':
+ break
</ins><span class="cx"> item = line.split(' ', 2)
</span><del>- #0 = STAT, 1 = ITEM, 2 = Value
</del><ins>+ # 0 = STAT, 1 = ITEM, 2 = Value
</ins><span class="cx"> slab = item[1].split(':', 2)
</span><del>- #0 = items, 1 = Slab #, 2 = Name
- if not serverData.has_key(slab[1]):
</del><ins>+ # 0 = items, 1 = Slab #, 2 = Name
+ if slab[1] not in serverData:
</ins><span class="cx"> serverData[slab[1]] = {}
</span><span class="cx"> serverData[slab[1]][slab[2]] = item[2]
</span><span class="cx"> return data
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def flush_all(self):
</span><span class="cx"> 'Expire all data currently in the memcache servers.'
</span><span class="cx"> for s in self.servers:
</span><del>- if not s.connect(): continue
</del><ins>+ if not s.connect():
+ continue
</ins><span class="cx"> s.send_cmd('flush_all')
</span><span class="cx"> s.expect("OK")
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def debuglog(self, str):
</span><span class="cx"> if self.debug:
</span><span class="cx"> sys.stderr.write("MemCached: %s\n" % str)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _statlog(self, func):
</span><del>- if not self.stats.has_key(func):
</del><ins>+ if func not in self.stats:
</ins><span class="cx"> self.stats[func] = 1
</span><span class="cx"> else:
</span><span class="cx"> self.stats[func] += 1
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def forget_dead_hosts(self):
</span><span class="cx"> """
</span><span class="cx"> Reset every host in the pool to an "alive" state.
</span><span class="lines">@@ -305,14 +341,16 @@
</span><span class="cx"> for s in self.servers:
</span><span class="cx"> s.deaduntil = 0
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _init_buckets(self):
</span><span class="cx"> self.buckets = []
</span><span class="cx"> for server in self.servers:
</span><del>- for i in range(server.weight):
</del><ins>+ for _ignroe_i in range(server.weight):
</ins><span class="cx"> self.buckets.append(server)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _get_server(self, key):
</span><del>- if type(key) == types.TupleType:
</del><ins>+ if isinstance(key, tuple):
</ins><span class="cx"> serverhash, key = key
</span><span class="cx"> else:
</span><span class="cx"> serverhash = serverHashFunction(key)
</span><span class="lines">@@ -320,16 +358,18 @@
</span><span class="cx"> for i in range(Client._SERVER_RETRIES):
</span><span class="cx"> server = self.buckets[serverhash % len(self.buckets)]
</span><span class="cx"> if server.connect():
</span><del>- #print("(using server %s)" % server, end="")
</del><ins>+ # print("(using server %s)" % server, end="")
</ins><span class="cx"> return server, key
</span><span class="cx"> serverhash = serverHashFunction(str(serverhash) + str(i))
</span><span class="cx"> log.error("Memcacheclient _get_server( ) failed to connect")
</span><span class="cx"> return None, None
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def disconnect_all(self):
</span><span class="cx"> for s in self.servers:
</span><span class="cx"> s.close_socket()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def delete_multi(self, keys, time=0, key_prefix=''):
</span><span class="cx"> '''
</span><span class="cx"> Delete multiple keys in the memcache doing just one query.
</span><span class="lines">@@ -359,7 +399,7 @@
</span><span class="cx">
</span><span class="cx"> self._statlog('delete_multi')
</span><span class="cx">
</span><del>- server_keys, prefixed_to_orig_key = self._map_and_prefix_keys(keys, key_prefix)
</del><ins>+ server_keys, _ignore_prefixed_to_orig_key = self._map_and_prefix_keys(keys, key_prefix)
</ins><span class="cx">
</span><span class="cx"> # send out all requests on each server before reading anything
</span><span class="cx"> dead_servers = []
</span><span class="lines">@@ -369,16 +409,17 @@
</span><span class="cx"> bigcmd = []
</span><span class="cx"> write = bigcmd.append
</span><span class="cx"> if time != None:
</span><del>- for key in server_keys[server]: # These are mangled keys
- write("delete %s %d\r\n" % (key, time))
</del><ins>+ for key in server_keys[server]: # These are mangled keys
+ write("delete %s %d\r\n" % (key, time))
</ins><span class="cx"> else:
</span><span class="cx"> for key in server_keys[server]: # These are mangled keys
</span><del>- write("delete %s\r\n" % key)
</del><ins>+ write("delete %s\r\n" % key)
</ins><span class="cx"> try:
</span><span class="cx"> server.send_cmds(''.join(bigcmd))
</span><span class="cx"> except socket.error, msg:
</span><span class="cx"> rc = 0
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> dead_servers.append(server)
</span><span class="cx">
</span><span class="lines">@@ -391,11 +432,13 @@
</span><span class="cx"> for key in keys:
</span><span class="cx"> server.expect("DELETED")
</span><span class="cx"> except socket.error, msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> rc = 0
</span><span class="cx"> return rc
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def delete(self, key, time=0):
</span><span class="cx"> '''Deletes a key from the memcache.
</span><span class="cx">
</span><span class="lines">@@ -417,11 +460,13 @@
</span><span class="cx"> server.send_cmd(cmd)
</span><span class="cx"> server.expect("DELETED")
</span><span class="cx"> except socket.error, msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> return 0
</span><span class="cx"> return 1
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def incr(self, key, delta=1):
</span><span class="cx"> """
</span><span class="cx"> Sends a command to the server to atomically increment the value for C{key} by
</span><span class="lines">@@ -447,6 +492,7 @@
</span><span class="cx"> """
</span><span class="cx"> return self._incrdecr("incr", key, delta)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def decr(self, key, delta=1):
</span><span class="cx"> """
</span><span class="cx"> Like L{incr}, but decrements. Unlike L{incr}, underflow is checked and
</span><span class="lines">@@ -459,6 +505,7 @@
</span><span class="cx"> """
</span><span class="cx"> return self._incrdecr("decr", key, delta)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _incrdecr(self, cmd, key, delta):
</span><span class="cx"> check_key(key)
</span><span class="cx"> server, key = self._get_server(key)
</span><span class="lines">@@ -471,11 +518,13 @@
</span><span class="cx"> line = server.readline()
</span><span class="cx"> return int(line)
</span><span class="cx"> except socket.error, msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> return None
</span><span class="cx">
</span><del>- def add(self, key, val, time = 0, min_compress_len = 0):
</del><ins>+
+ def add(self, key, val, time=0, min_compress_len=0):
</ins><span class="cx"> '''
</span><span class="cx"> Add new key with value.
</span><span class="cx">
</span><span class="lines">@@ -486,6 +535,7 @@
</span><span class="cx"> '''
</span><span class="cx"> return self._set("add", key, val, time, min_compress_len)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def append(self, key, val, time=0, min_compress_len=0):
</span><span class="cx"> '''Append the value to the end of the existing key's value.
</span><span class="cx">
</span><span class="lines">@@ -497,6 +547,7 @@
</span><span class="cx"> '''
</span><span class="cx"> return self._set("append", key, val, time, min_compress_len)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def prepend(self, key, val, time=0, min_compress_len=0):
</span><span class="cx"> '''Prepend the value to the beginning of the existing key's value.
</span><span class="cx">
</span><span class="lines">@@ -508,6 +559,7 @@
</span><span class="cx"> '''
</span><span class="cx"> return self._set("prepend", key, val, time, min_compress_len)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def replace(self, key, val, time=0, min_compress_len=0):
</span><span class="cx"> '''Replace existing key with value.
</span><span class="cx">
</span><span class="lines">@@ -519,6 +571,7 @@
</span><span class="cx"> '''
</span><span class="cx"> return self._set("replace", key, val, time, min_compress_len)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def set(self, key, val, time=0, min_compress_len=0, token=None):
</span><span class="cx"> '''Unconditionally sets a key to a given value in the memcache.
</span><span class="cx">
</span><span class="lines">@@ -553,7 +606,7 @@
</span><span class="cx">
</span><span class="cx"> """
</span><span class="cx"> # Check it just once ...
</span><del>- key_extra_len=len(key_prefix)
</del><ins>+ key_extra_len = len(key_prefix)
</ins><span class="cx"> if key_prefix:
</span><span class="cx"> check_key(key_prefix)
</span><span class="cx">
</span><span class="lines">@@ -563,7 +616,7 @@
</span><span class="cx"> prefixed_to_orig_key = {}
</span><span class="cx"> # build up a list for each server of all the keys we want.
</span><span class="cx"> for orig_key in key_iterable:
</span><del>- if type(orig_key) is types.TupleType:
</del><ins>+ if isinstance(orig_key, tuple):
</ins><span class="cx"> # Tuple of hashvalue, key ala _get_server(). Caller is essentially telling us what server to stuff this on.
</span><span class="cx"> # Ensure call to _get_server gets a Tuple as well.
</span><span class="cx"> str_orig_key = str(orig_key[1])
</span><span class="lines">@@ -578,13 +631,14 @@
</span><span class="cx"> if not server:
</span><span class="cx"> continue
</span><span class="cx">
</span><del>- if not server_keys.has_key(server):
</del><ins>+ if server not in server_keys:
</ins><span class="cx"> server_keys[server] = []
</span><span class="cx"> server_keys[server].append(key)
</span><span class="cx"> prefixed_to_orig_key[key] = orig_key
</span><span class="cx">
</span><span class="cx"> return (server_keys, prefixed_to_orig_key)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def set_multi(self, mapping, time=0, key_prefix='', min_compress_len=0):
</span><span class="cx"> '''
</span><span class="cx"> Sets multiple keys in the memcache doing just one query.
</span><span class="lines">@@ -628,8 +682,6 @@
</span><span class="cx">
</span><span class="cx"> self._statlog('set_multi')
</span><span class="cx">
</span><del>-
-
</del><span class="cx"> server_keys, prefixed_to_orig_key = self._map_and_prefix_keys(mapping.iterkeys(), key_prefix)
</span><span class="cx">
</span><span class="cx"> # send out all requests on each server before reading anything
</span><span class="lines">@@ -644,7 +696,8 @@
</span><span class="cx"> write("set %s %d %d %d\r\n%s\r\n" % (key, store_info[0], time, store_info[1], store_info[2]))
</span><span class="cx"> server.send_cmds(''.join(bigcmd))
</span><span class="cx"> except socket.error, msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> dead_servers.append(server)
</span><span class="cx">
</span><span class="lines">@@ -653,7 +706,8 @@
</span><span class="cx"> del server_keys[server]
</span><span class="cx">
</span><span class="cx"> # short-circuit if there are no servers, just return all keys
</span><del>- if not server_keys: return(mapping.keys())
</del><ins>+ if not server_keys:
+ return(mapping.keys())
</ins><span class="cx">
</span><span class="cx"> notstored = [] # original keys.
</span><span class="cx"> for server, keys in server_keys.iteritems():
</span><span class="lines">@@ -663,12 +717,14 @@
</span><span class="cx"> if line == 'STORED':
</span><span class="cx"> continue
</span><span class="cx"> else:
</span><del>- notstored.append(prefixed_to_orig_key[key]) #un-mangle.
</del><ins>+ notstored.append(prefixed_to_orig_key[key]) # un-mangle.
</ins><span class="cx"> except (_Error, socket.error), msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> return notstored
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _val_to_store_info(self, val, min_compress_len):
</span><span class="cx"> """
</span><span class="cx"> Transform val to a storable representation, returning a tuple of the flags, the length of the new value, and the new value itself.
</span><span class="lines">@@ -690,7 +746,7 @@
</span><span class="cx"> flags |= Client._FLAG_PICKLE
</span><span class="cx"> file = StringIO()
</span><span class="cx"> if self.picklerIsKeyword:
</span><del>- pickler = self.pickler(file, protocol = self.pickleProtocol)
</del><ins>+ pickler = self.pickler(file, protocol=self.pickleProtocol)
</ins><span class="cx"> else:
</span><span class="cx"> pickler = self.pickler(file, self.pickleProtocol)
</span><span class="cx"> if self.persistent_id:
</span><span class="lines">@@ -710,11 +766,13 @@
</span><span class="cx"> val = comp_val
</span><span class="cx">
</span><span class="cx"> # silently do not store if value length exceeds maximum
</span><del>- if len(val) >= SERVER_MAX_VALUE_LENGTH: return(0)
</del><ins>+ if len(val) >= SERVER_MAX_VALUE_LENGTH:
+ return(0)
</ins><span class="cx">
</span><span class="cx"> return (flags, len(val), val)
</span><span class="cx">
</span><del>- def _set(self, cmd, key, val, time, min_compress_len = 0, token=None):
</del><ins>+
+ def _set(self, cmd, key, val, time, min_compress_len=0, token=None):
</ins><span class="cx"> check_key(key)
</span><span class="cx"> server, key = self._get_server(key)
</span><span class="cx"> if not server:
</span><span class="lines">@@ -723,7 +781,8 @@
</span><span class="cx"> self._statlog(cmd)
</span><span class="cx">
</span><span class="cx"> store_info = self._val_to_store_info(val, min_compress_len)
</span><del>- if not store_info: return(0)
</del><ins>+ if not store_info:
+ return(0)
</ins><span class="cx">
</span><span class="cx"> if token is not None:
</span><span class="cx"> cmd = "cas"
</span><span class="lines">@@ -744,16 +803,17 @@
</span><span class="cx"> log.debug("Memcacheclient check-and-set failed")
</span><span class="cx"> raise TokenMismatchError(key)
</span><span class="cx">
</span><del>- log.error("Memcacheclient %s command failed with result (%s)" %
- (cmd, result))
</del><ins>+ log.error("Memcacheclient %s command failed with result (%s)" % (cmd, result))
</ins><span class="cx">
</span><span class="cx"> return False
</span><span class="cx">
</span><span class="cx"> except socket.error, msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> return 0
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def get(self, key):
</span><span class="cx"> '''Retrieves a key from the memcache.
</span><span class="cx">
</span><span class="lines">@@ -774,11 +834,13 @@
</span><span class="cx"> value = self._recv_value(server, flags, rlen)
</span><span class="cx"> server.expect("END")
</span><span class="cx"> except (_Error, socket.error), msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> raise MemcacheError("Memcache connection error")
</span><span class="cx"> return value
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def gets(self, key):
</span><span class="cx"> '''Retrieves a key from the memcache.
</span><span class="cx">
</span><span class="lines">@@ -799,11 +861,13 @@
</span><span class="cx"> value = self._recv_value(server, flags, rlen)
</span><span class="cx"> server.expect("END")
</span><span class="cx"> except (_Error, socket.error), msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> raise MemcacheError("Memcache connection error")
</span><span class="cx"> return (value, cas_token)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def get_multi(self, keys, key_prefix=''):
</span><span class="cx"> '''
</span><span class="cx"> Retrieves multiple keys from the memcache doing just one query.
</span><span class="lines">@@ -852,7 +916,8 @@
</span><span class="cx"> try:
</span><span class="cx"> server.send_cmd("get %s" % " ".join(server_keys[server]))
</span><span class="cx"> except socket.error, msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> dead_servers.append(server)
</span><span class="cx">
</span><span class="lines">@@ -875,10 +940,12 @@
</span><span class="cx"> pass
</span><span class="cx"> line = server.readline()
</span><span class="cx"> except (_Error, socket.error), msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> return retvals
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def gets_multi(self, keys, key_prefix=''):
</span><span class="cx"> '''
</span><span class="cx"> Retrieves multiple keys from the memcache doing just one query.
</span><span class="lines">@@ -895,7 +962,8 @@
</span><span class="cx"> try:
</span><span class="cx"> server.send_cmd("gets %s" % " ".join(server_keys[server]))
</span><span class="cx"> except socket.error, msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> dead_servers.append(server)
</span><span class="cx">
</span><span class="lines">@@ -918,34 +986,38 @@
</span><span class="cx"> pass
</span><span class="cx"> line = server.readline()
</span><span class="cx"> except (_Error, socket.error), msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
</ins><span class="cx"> server.mark_dead(msg)
</span><span class="cx"> return retvals
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _expectvalue(self, server, line=None):
</span><span class="cx"> if not line:
</span><span class="cx"> line = server.readline()
</span><span class="cx">
</span><span class="cx"> if line[:5] == 'VALUE':
</span><del>- resp, rkey, flags, len = line.split()
</del><ins>+ _ignore_resp, rkey, flags, len = line.split()
</ins><span class="cx"> flags = int(flags)
</span><span class="cx"> rlen = int(len)
</span><span class="cx"> return (rkey, flags, rlen)
</span><span class="cx"> else:
</span><span class="cx"> return (None, None, None)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _expectvalue_cas(self, server, line=None):
</span><span class="cx"> if not line:
</span><span class="cx"> line = server.readline()
</span><span class="cx">
</span><span class="cx"> if line[:5] == 'VALUE':
</span><del>- resp, rkey, flags, len, rtoken = line.split()
</del><ins>+ _ignore_resp, rkey, flags, len, rtoken = line.split()
</ins><span class="cx"> flags = int(flags)
</span><span class="cx"> rlen = int(len)
</span><span class="cx"> return (rkey, flags, rlen, rtoken)
</span><span class="cx"> else:
</span><span class="cx"> return (None, None, None, None)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _recv_value(self, server, flags, rlen):
</span><span class="cx"> rlen += 2 # include \r\n
</span><span class="cx"> buf = server.recv(rlen)
</span><span class="lines">@@ -958,8 +1030,7 @@
</span><span class="cx"> if flags & Client._FLAG_COMPRESSED:
</span><span class="cx"> buf = decompress(buf)
</span><span class="cx">
</span><del>-
- if flags == 0 or flags == Client._FLAG_COMPRESSED:
</del><ins>+ if flags == 0 or flags == Client._FLAG_COMPRESSED:
</ins><span class="cx"> # Either a bare string or a compressed string now decompressed...
</span><span class="cx"> val = buf
</span><span class="cx"> elif flags & Client._FLAG_INTEGER:
</span><span class="lines">@@ -995,7 +1066,8 @@
</span><span class="cx">
</span><span class="cx"> local.__init__(self)
</span><span class="cx">
</span><del>- super(TestClient, self).__init__(servers, debug=debug,
</del><ins>+ super(TestClient, self).__init__(
+ servers, debug=debug,
</ins><span class="cx"> pickleProtocol=pickleProtocol, pickler=pickler, unpickler=unpickler,
</span><span class="cx"> pload=pload, pid=pid)
</span><span class="cx">
</span><span class="lines">@@ -1003,19 +1075,22 @@
</span><span class="cx"> self.token = 0
</span><span class="cx">
</span><span class="cx">
</span><del>-
</del><span class="cx"> def get_stats(self):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def get_slabs(self):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def flush_all(self):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def forget_dead_hosts(self):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def delete_multi(self, keys, time=0, key_prefix=''):
</span><span class="cx"> '''
</span><span class="cx"> Delete multiple keys in the memcache doing just one query.
</span><span class="lines">@@ -1035,6 +1110,7 @@
</span><span class="cx"> del self.data[key]
</span><span class="cx"> return 1
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def delete(self, key, time=0):
</span><span class="cx"> '''Deletes a key from the memcache.
</span><span class="cx">
</span><span class="lines">@@ -1050,25 +1126,32 @@
</span><span class="cx"> def incr(self, key, delta=1):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def decr(self, key, delta=1):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><del>- def add(self, key, val, time = 0, min_compress_len = 0):
</del><ins>+
+ def add(self, key, val, time=0, min_compress_len=0):
</ins><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def append(self, key, val, time=0, min_compress_len=0):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def prepend(self, key, val, time=0, min_compress_len=0):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def replace(self, key, val, time=0, min_compress_len=0):
</span><span class="cx"> raise NotImplementedError()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def set(self, key, val, time=0, min_compress_len=0, token=None):
</span><span class="cx"> self._statlog('set')
</span><span class="cx"> return self._set("set", key, val, time, min_compress_len, token=token)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def set_multi(self, mapping, time=0, key_prefix='', min_compress_len=0):
</span><span class="cx"> self._statlog('set_multi')
</span><span class="cx"> for key, val in mapping.iteritems():
</span><span class="lines">@@ -1076,15 +1159,16 @@
</span><span class="cx"> self._set("set", key, val, time, min_compress_len)
</span><span class="cx"> return []
</span><span class="cx">
</span><del>- def _set(self, cmd, key, val, time, min_compress_len = 0, token=None):
</del><ins>+
+ def _set(self, cmd, key, val, time, min_compress_len=0, token=None):
</ins><span class="cx"> check_key(key)
</span><span class="cx"> self._statlog(cmd)
</span><span class="cx">
</span><span class="cx"> serialized = pickle.dumps(val, pickle.HIGHEST_PROTOCOL)
</span><span class="cx">
</span><span class="cx"> if token is not None:
</span><del>- if self.data.has_key(key):
- stored_val, stored_token = self.data[key]
</del><ins>+ if key in self.data:
+ _ignore_stored_val, stored_token = self.data[key]
</ins><span class="cx"> if token != stored_token:
</span><span class="cx"> raise TokenMismatchError(key)
</span><span class="cx">
</span><span class="lines">@@ -1093,12 +1177,13 @@
</span><span class="cx">
</span><span class="cx"> return True
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def get(self, key):
</span><span class="cx"> check_key(key)
</span><span class="cx">
</span><span class="cx"> self._statlog('get')
</span><del>- if self.data.has_key(key):
- stored_val, stored_token = self.data[key]
</del><ins>+ if key in self.data:
+ stored_val, _ignore_stored_token = self.data[key]
</ins><span class="cx"> val = pickle.loads(stored_val)
</span><span class="cx"> return val
</span><span class="cx"> return None
</span><span class="lines">@@ -1106,12 +1191,13 @@
</span><span class="cx">
</span><span class="cx"> def gets(self, key):
</span><span class="cx"> check_key(key)
</span><del>- if self.data.has_key(key):
</del><ins>+ if key in self.data:
</ins><span class="cx"> stored_val, stored_token = self.data[key]
</span><span class="cx"> val = pickle.loads(stored_val)
</span><span class="cx"> return (val, stored_token)
</span><span class="cx"> return (None, None)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def get_multi(self, keys, key_prefix=''):
</span><span class="cx"> self._statlog('get_multi')
</span><span class="cx">
</span><span class="lines">@@ -1122,6 +1208,7 @@
</span><span class="cx"> results[key] = val
</span><span class="cx"> return results
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def gets_multi(self, keys, key_prefix=''):
</span><span class="cx"> self._statlog('gets_multi')
</span><span class="cx"> results = {}
</span><span class="lines">@@ -1133,6 +1220,7 @@
</span><span class="cx"> return results
</span><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> class _Host:
</span><span class="cx"> _DEAD_RETRY = 1 # number of seconds before retrying a dead server.
</span><span class="cx"> _SOCKET_TIMEOUT = 3 # number of seconds before sockets timeout.
</span><span class="lines">@@ -1146,10 +1234,12 @@
</span><span class="cx"> # parse the connection string
</span><span class="cx"> m = re.match(r'^(?P<proto>unix):(?P<path>.*)$', host)
</span><span class="cx"> if not m:
</span><del>- m = re.match(r'^(?P<proto>inet):'
- r'(?P<host>[^:]+)(:(?P<port>[0-9]+))?$', host)
- if not m: m = re.match(r'^(?P<host>[^:]+):(?P<port>[0-9]+)$', host)
</del><ins>+ m = re.match(
+ r'^(?P<proto>inet):'
+ r'(?P<host>[^:]+)(:(?P<port>[0-9]+))?$', host)
</ins><span class="cx"> if not m:
</span><ins>+ m = re.match(r'^(?P<host>[^:]+):(?P<port>[0-9]+)$', host)
+ if not m:
</ins><span class="cx"> raise ValueError('Unable to parse connection string: "%s"' % host)
</span><span class="cx">
</span><span class="cx"> hostData = m.groupdict()
</span><span class="lines">@@ -1160,7 +1250,7 @@
</span><span class="cx"> self.family = socket.AF_INET
</span><span class="cx"> self.ip = hostData['host']
</span><span class="cx"> self.port = int(hostData.get('port', 11211))
</span><del>- self.address = ( self.ip, self.port )
</del><ins>+ self.address = (self.ip, self.port)
</ins><span class="cx">
</span><span class="cx"> if not debugfunc:
</span><span class="cx"> debugfunc = lambda x: x
</span><span class="lines">@@ -1171,23 +1261,27 @@
</span><span class="cx">
</span><span class="cx"> self.buffer = ''
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _check_dead(self):
</span><span class="cx"> if self.deaduntil and self.deaduntil > time.time():
</span><span class="cx"> return 1
</span><span class="cx"> self.deaduntil = 0
</span><span class="cx"> return 0
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def connect(self):
</span><span class="cx"> if self._get_socket():
</span><span class="cx"> return 1
</span><span class="cx"> return 0
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def mark_dead(self, reason):
</span><span class="cx"> log.error("Memcacheclient socket marked dead (%s)" % (reason,))
</span><span class="cx"> self.debuglog("MemCache: %s: %s. Marking dead." % (self, reason))
</span><span class="cx"> self.deaduntil = time.time() + _Host._DEAD_RETRY
</span><span class="cx"> self.close_socket()
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _get_socket(self):
</span><span class="cx"> if self._check_dead():
</span><span class="cx"> log.error("Memcacheclient _get_socket() found dead socket")
</span><span class="lines">@@ -1195,36 +1289,40 @@
</span><span class="cx"> if self.socket:
</span><span class="cx"> return self.socket
</span><span class="cx"> s = socket.socket(self.family, socket.SOCK_STREAM)
</span><del>- if hasattr(s, 'settimeout'): s.settimeout(self._SOCKET_TIMEOUT)
</del><ins>+ if hasattr(s, 'settimeout'):
+ s.settimeout(self._SOCKET_TIMEOUT)
</ins><span class="cx"> try:
</span><span class="cx"> s.connect(self.address)
</span><span class="cx"> except socket.timeout, msg:
</span><del>- log.error("Memcacheclient _get_socket() connection timed out (%s)" %
- (msg,))
</del><ins>+ log.error("Memcacheclient _get_socket() connection timed out (%s)" % (msg,))
</ins><span class="cx"> self.mark_dead("connect: %s" % msg)
</span><span class="cx"> return None
</span><span class="cx"> except socket.error, msg:
</span><del>- if type(msg) is types.TupleType: msg = msg[1]
- log.error("Memcacheclient _get_socket() connection error (%s)" %
- (msg,))
</del><ins>+ if isinstance(msg, tuple):
+ msg = msg[1]
+ log.error("Memcacheclient _get_socket() connection error (%s)" % (msg,))
</ins><span class="cx"> self.mark_dead("connect: %s" % msg[1])
</span><span class="cx"> return None
</span><span class="cx"> self.socket = s
</span><span class="cx"> self.buffer = ''
</span><span class="cx"> return s
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def close_socket(self):
</span><span class="cx"> if self.socket:
</span><span class="cx"> self.socket.close()
</span><span class="cx"> self.socket = None
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def send_cmd(self, cmd):
</span><span class="cx"> self.socket.sendall(cmd + '\r\n')
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def send_cmds(self, cmds):
</span><span class="cx"> """ cmds already has trailing \r\n's applied """
</span><span class="cx"> self.socket.sendall(cmds)
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def readline(self):
</span><span class="cx"> buf = self.buffer
</span><span class="cx"> recv = self.socket.recv
</span><span class="lines">@@ -1234,23 +1332,24 @@
</span><span class="cx"> break
</span><span class="cx"> data = recv(4096)
</span><span class="cx"> if not data:
</span><del>- self.mark_dead('Connection closed while reading from %s'
- % repr(self))
</del><ins>+ self.mark_dead('Connection closed while reading from %s' % repr(self))
</ins><span class="cx"> break
</span><span class="cx"> buf += data
</span><span class="cx"> if index >= 0:
</span><del>- self.buffer = buf[index+2:]
</del><ins>+ self.buffer = buf[index + 2:]
</ins><span class="cx"> buf = buf[:index]
</span><span class="cx"> else:
</span><span class="cx"> self.buffer = ''
</span><span class="cx"> return buf
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def expect(self, text):
</span><span class="cx"> line = self.readline()
</span><span class="cx"> if line != text:
</span><span class="cx"> self.debuglog("while expecting '%s', got unexpected response '%s'" % (text, line))
</span><span class="cx"> return line
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def recv(self, rlen):
</span><span class="cx"> self_socket_recv = self.socket.recv
</span><span class="cx"> buf = self.buffer
</span><span class="lines">@@ -1258,11 +1357,13 @@
</span><span class="cx"> foo = self_socket_recv(4096)
</span><span class="cx"> buf += foo
</span><span class="cx"> if len(foo) == 0:
</span><del>- raise _Error, ( 'Read %d bytes, expecting %d, '
- 'read returned 0 length bytes' % ( len(buf), rlen ))
</del><ins>+ raise _Error, (
+ 'Read %d bytes, expecting %d, '
+ 'read returned 0 length bytes' % (len(buf), rlen))
</ins><span class="cx"> self.buffer = buf[rlen:]
</span><span class="cx"> return buf[:rlen]
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def __str__(self):
</span><span class="cx"> d = ''
</span><span class="cx"> if self.deaduntil:
</span><span class="lines">@@ -1273,6 +1374,8 @@
</span><span class="cx"> else:
</span><span class="cx"> return "unix:%s%s" % (self.address, d)
</span><span class="cx">
</span><ins>+
+
</ins><span class="cx"> def check_key(key, key_extra_len=0):
</span><span class="cx"> """Checks sanity of key. Fails if:
</span><span class="cx"> Key length is > SERVER_MAX_KEY_LENGTH (Raises MemcachedKeyLength).
</span><span class="lines">@@ -1285,26 +1388,32 @@
</span><span class="cx">
</span><span class="cx"> return # Short-circuit this expensive method
</span><span class="cx">
</span><del>- if type(key) == types.TupleType: key = key[1]
</del><ins>+ if isinstance(key, tuple):
+ key = key[1]
</ins><span class="cx"> if not key:
</span><span class="cx"> raise Client.MemcachedKeyNoneError, ("Key is None")
</span><span class="cx"> if isinstance(key, unicode):
</span><del>- raise Client.MemcachedStringEncodingError, ("Keys must be str()'s, not "
- "unicode. Convert your unicode strings using "
- "mystring.encode(charset)!")
</del><ins>+ raise Client.MemcachedStringEncodingError, (
+ "Keys must be str()'s, not "
+ "unicode. Convert your unicode strings using "
+ "mystring.encode(charset)!")
</ins><span class="cx"> if not isinstance(key, str):
</span><span class="cx"> raise Client.MemcachedKeyTypeError, ("Key must be str()'s")
</span><span class="cx">
</span><span class="cx"> if isinstance(key, basestring):
</span><span class="cx"> if len(key) + key_extra_len > SERVER_MAX_KEY_LENGTH:
</span><del>- raise Client.MemcachedKeyLengthError, ("Key length is > %s"
- % SERVER_MAX_KEY_LENGTH)
</del><ins>+ raise Client.MemcachedKeyLengthError, (
+ "Key length is > %s"
+ % SERVER_MAX_KEY_LENGTH)
</ins><span class="cx"> for char in key:
</span><span class="cx"> if ord(char) < 32 or ord(char) == 127:
</span><span class="cx"> raise Client.MemcachedKeyCharacterError, "Control characters not allowed"
</span><span class="cx">
</span><ins>+
+
</ins><span class="cx"> def _doctest():
</span><del>- import doctest, memcacheclient
</del><ins>+ import doctest
+ from twistedcaldav import memcacheclient
</ins><span class="cx"> servers = ["127.0.0.1:11211"]
</span><span class="cx"> mc = Client(servers, debug=1)
</span><span class="cx"> globs = {"mc": mc}
</span><span class="lines">@@ -1350,7 +1459,7 @@
</span><span class="cx">
</span><span class="cx"> test_setget("a_string", "some random string")
</span><span class="cx"> test_setget("an_integer", 42)
</span><del>- if test_setget("long", long(1<<30)):
</del><ins>+ if test_setget("long", long(1 << 30)):
</ins><span class="cx"> print("Testing delete ...", end="")
</span><span class="cx"> if mc.delete("long"):
</span><span class="cx"> print("OK")
</span><span class="lines">@@ -1398,7 +1507,7 @@
</span><span class="cx">
</span><span class="cx"> print("Testing using insanely long key...", end="")
</span><span class="cx"> try:
</span><del>- x = mc.set('a'*SERVER_MAX_KEY_LENGTH + 'aaaa', 1)
</del><ins>+ x = mc.set('a' * SERVER_MAX_KEY_LENGTH + 'aaaa', 1)
</ins><span class="cx"> except Client.MemcachedKeyLengthError, msg:
</span><span class="cx"> print("OK")
</span><span class="cx"> else:
</span><span class="lines">@@ -1412,26 +1521,26 @@
</span><span class="cx"> else:
</span><span class="cx"> print("FAIL", end="")
</span><span class="cx"> try:
</span><del>- x = mc.set((u'a'*SERVER_MAX_KEY_LENGTH).encode('utf-8'), 1)
</del><ins>+ x = mc.set((u'a' * SERVER_MAX_KEY_LENGTH).encode('utf-8'), 1)
</ins><span class="cx"> except:
</span><span class="cx"> print("FAIL", end="")
</span><span class="cx"> else:
</span><span class="cx"> print("OK", end="")
</span><span class="cx"> s = pickle.loads('V\\u4f1a\np0\n.')
</span><span class="cx"> try:
</span><del>- x = mc.set((s*SERVER_MAX_KEY_LENGTH).encode('utf-8'), 1)
</del><ins>+ x = mc.set((s * SERVER_MAX_KEY_LENGTH).encode('utf-8'), 1)
</ins><span class="cx"> except Client.MemcachedKeyLengthError:
</span><span class="cx"> print("OK")
</span><span class="cx"> else:
</span><span class="cx"> print("FAIL")
</span><span class="cx">
</span><span class="cx"> print("Testing using a value larger than the memcached value limit...", end="")
</span><del>- x = mc.set('keyhere', 'a'*SERVER_MAX_VALUE_LENGTH)
</del><ins>+ x = mc.set('keyhere', 'a' * SERVER_MAX_VALUE_LENGTH)
</ins><span class="cx"> if mc.get('keyhere') == None:
</span><span class="cx"> print("OK", end="")
</span><span class="cx"> else:
</span><span class="cx"> print("FAIL", end="")
</span><del>- x = mc.set('keyhere', 'a'*SERVER_MAX_VALUE_LENGTH + 'aaa')
</del><ins>+ x = mc.set('keyhere', 'a' * SERVER_MAX_VALUE_LENGTH + 'aaa')
</ins><span class="cx"> if mc.get('keyhere') == None:
</span><span class="cx"> print("OK")
</span><span class="cx"> else:
</span><span class="lines">@@ -1451,6 +1560,6 @@
</span><span class="cx"> if ret != 1:
</span><span class="cx"> print("FAIL")
</span><span class="cx"> else:
</span><del>- print("OK")
</del><ins>+ print("OK")
</ins><span class="cx">
</span><span class="cx"> # vim: ts=4 sw=4 et :
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavmemcachepropspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/memcacheprops.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/memcacheprops.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/memcacheprops.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -66,7 +66,8 @@
</span><span class="cx">
</span><span class="cx"> cls.log.info("Instantiating memcache connection for MemcachePropertyCollection")
</span><span class="cx">
</span><del>- MemcachePropertyCollection._memcacheClient = ClientFactory.getClient([
</del><ins>+ MemcachePropertyCollection._memcacheClient = ClientFactory.getClient(
+ [
</ins><span class="cx"> "%s:%s" % (config.Memcached.Pools.Default.BindAddress, config.Memcached.Pools.Default.Port)
</span><span class="cx"> ],
</span><span class="cx"> debug=0,
</span><span class="lines">@@ -106,9 +107,9 @@
</span><span class="cx"> self.log.debug("No child property cache for %s" % (child,))
</span><span class="cx"> childCache, token = ({}, None)
</span><span class="cx">
</span><del>- #message = "No child property cache for %s" % (child,)
- #self.log.error(message)
- #raise AssertionError(message)
</del><ins>+ # message = "No child property cache for %s" % (child,)
+ # self.log.error(message)
+ # raise AssertionError(message)
</ins><span class="cx">
</span><span class="cx"> return propertyCache, key, childCache, token
</span><span class="cx">
</span><span class="lines">@@ -143,8 +144,10 @@
</span><span class="cx"> for childName in childNames
</span><span class="cx"> ))
</span><span class="cx">
</span><del>- result = self._split_gets_multi((key for key, _ignore_name in keys),
- client.gets_multi)
</del><ins>+ result = self._split_gets_multi(
+ (key for key, _ignore_name in keys),
+ client.gets_multi
+ )
</ins><span class="cx">
</span><span class="cx"> if abortIfMissing:
</span><span class="cx"> missing = "missing "
</span><span class="lines">@@ -227,8 +230,10 @@
</span><span class="cx">
</span><span class="cx"> client = self.memcacheClient()
</span><span class="cx"> if client is not None:
</span><del>- self._split_set_multi(values, client.set_multi,
- time=self.cacheTimeout)
</del><ins>+ self._split_set_multi(
+ values, client.set_multi,
+ time=self.cacheTimeout
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def _buildCache(self, childNames=None):
</span><span class="lines">@@ -277,8 +282,10 @@
</span><span class="cx"> retries = 10
</span><span class="cx"> while retries:
</span><span class="cx"> try:
</span><del>- if client.set(key, childCache, time=self.cacheTimeout,
- token=token):
</del><ins>+ if client.set(
+ key, childCache, time=self.cacheTimeout,
+ token=token
+ ):
</ins><span class="cx"> # Success
</span><span class="cx"> break
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavmemcacherpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/memcacher.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/memcacher.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/memcacher.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx"> self._clock += seconds
</span><span class="cx">
</span><span class="cx">
</span><del>- #TODO: an sqlite based cacher that can be used for multiple instance servers
</del><ins>+ # TODO: an sqlite based cacher that can be used for multiple instance servers
</ins><span class="cx"> # in the absence of memcached. This is not ideal and we may want to not implement
</span><span class="cx"> # this, but it is being documented for completeness.
</span><span class="cx"> #
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavmethodmkcolpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/method/mkcol.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/method/mkcol.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/method/mkcol.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -154,8 +154,10 @@
</span><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, error))
</span><span class="cx">
</span><span class="cx"> # Make sure feature is enabled
</span><del>- if (rtype == "calendar" and not config.EnableCalDAV or
- rtype == "addressbook" and not config.EnableCardDAV):
</del><ins>+ if (
+ rtype == "calendar" and not config.EnableCalDAV or
+ rtype == "addressbook" and not config.EnableCardDAV
+ ):
</ins><span class="cx"> error = "{DAV:}resourcetype property in MKCOL request body not supported: %s" % (mkcol,)
</span><span class="cx"> log.error("Error: {err}", err=error)
</span><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, error))
</span><span class="lines">@@ -184,8 +186,8 @@
</span><span class="cx"> # Clean up
</span><span class="cx"> errors.error()
</span><span class="cx"> raise HTTPError(Response(
</span><del>- code=responsecode.FORBIDDEN,
- stream=mkcolxml.MakeCollectionResponse(errors.response()).toxml()
</del><ins>+ code=responsecode.FORBIDDEN,
+ stream=mkcolxml.MakeCollectionResponse(errors.response()).toxml()
</ins><span class="cx"> ))
</span><span class="cx">
</span><span class="cx"> # When calendar collections are single component only, default MKCALENDAR is VEVENT only
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavmethodreport_addressbook_querypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/method/report_addressbook_query.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/method/report_addressbook_query.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/method/report_addressbook_query.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -178,18 +178,18 @@
</span><span class="cx">
</span><span class="cx"> if not addrresource.isAddressBookCollection():
</span><span class="cx">
</span><del>- #do UID lookup on last part of uri
</del><ins>+ # do UID lookup on last part of uri
</ins><span class="cx"> resource_name = urllib.unquote(uri[uri.rfind("/") + 1:])
</span><span class="cx"> if resource_name.endswith(".vcf") and len(resource_name) > 4:
</span><span class="cx">
</span><span class="cx"> # see if parent is directory backed address book
</span><del>- parent = (yield addrresource.locateParent(request, uri))
</del><ins>+ parent = (yield addrresource.locateParent(request, uri))
</ins><span class="cx">
</span><span class="cx"> # Check whether supplied resource is an address book or an address book object resource
</span><span class="cx"> if addrresource.isAddressBookCollection():
</span><span class="cx">
</span><span class="cx"> if addrresource.isDirectoryBackedAddressBookCollection():
</span><del>- yield maybeDeferred(queryDirectoryBackedAddressBook, addrresource, filter)
</del><ins>+ yield maybeDeferred(queryDirectoryBackedAddressBook, addrresource, filter)
</ins><span class="cx">
</span><span class="cx"> else:
</span><span class="cx">
</span><span class="lines">@@ -240,17 +240,17 @@
</span><span class="cx"> if resource_name.endswith(".vcf") and len(resource_name) > 4:
</span><span class="cx">
</span><span class="cx"> # see if parent is directory backed address book
</span><del>- parent = (yield addrresource.locateParent(request, uri))
</del><ins>+ parent = (yield addrresource.locateParent(request, uri))
</ins><span class="cx">
</span><span class="cx"> if parent.isDirectoryBackedAddressBookCollection():
</span><span class="cx">
</span><span class="cx"> vCardFilter = carddavxml.Filter(*[carddavxml.PropertyFilter(
</span><del>- carddavxml.TextMatch.fromString(resource_name[:-4]),
- name="UID", # attributes
- ), ])
</del><ins>+ carddavxml.TextMatch.fromString(resource_name[:-4]),
+ name="UID", # attributes
+ ), ])
</ins><span class="cx"> vCardFilter = Filter(vCardFilter)
</span><span class="cx">
</span><del>- yield maybeDeferred(queryDirectoryBackedAddressBook, parent, vCardFilter)
</del><ins>+ yield maybeDeferred(queryDirectoryBackedAddressBook, parent, vCardFilter)
</ins><span class="cx"> handled = True
</span><span class="cx">
</span><span class="cx"> if not handled:
</span><span class="lines">@@ -267,11 +267,11 @@
</span><span class="cx"> except NumberOfMatchesWithinLimits, e:
</span><span class="cx"> self.log.info("Too many matching components in addressbook-query report. Limited to {limit} items", limit=e.maxLimit())
</span><span class="cx"> responses.append(davxml.StatusResponse(
</span><del>- davxml.HRef.fromString(request.uri),
- davxml.Status.fromResponseCode(responsecode.INSUFFICIENT_STORAGE_SPACE),
- davxml.Error(davxml.NumberOfMatchesWithinLimits()),
- davxml.ResponseDescription("Results limited to {limit} items".format(limit=e.maxLimit())),
- ))
</del><ins>+ davxml.HRef.fromString(request.uri),
+ davxml.Status.fromResponseCode(responsecode.INSUFFICIENT_STORAGE_SPACE),
+ davxml.Error(davxml.NumberOfMatchesWithinLimits()),
+ davxml.ResponseDescription("Results limited to {limit} items".format(limit=e.maxLimit())),
+ ))
</ins><span class="cx">
</span><span class="cx"> if not hasattr(request, "extendedLogItems"):
</span><span class="cx"> request.extendedLogItems = {}
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavmethodreport_commonpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/method/report_common.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/method/report_common.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/method/report_common.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -574,14 +574,14 @@
</span><span class="cx">
</span><span class="cx"> # Create fake filter element to match time-range
</span><span class="cx"> filter = caldavxml.Filter(
</span><del>- caldavxml.ComponentFilter(
- caldavxml.ComponentFilter(
- cache_timerange if caching else timerange,
- name=("VEVENT", "VFREEBUSY", "VAVAILABILITY"),
- ),
- name="VCALENDAR",
- )
- )
</del><ins>+ caldavxml.ComponentFilter(
+ caldavxml.ComponentFilter(
+ cache_timerange if caching else timerange,
+ name=("VEVENT", "VFREEBUSY", "VAVAILABILITY"),
+ ),
+ name="VCALENDAR",
+ )
+ )
</ins><span class="cx"> filter = Filter(filter)
</span><span class="cx"> tzinfo = filter.settimezone(tz)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavmethodreport_multiget_commonpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/method/report_multiget_common.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/method/report_multiget_common.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/method/report_multiget_common.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -252,9 +252,9 @@
</span><span class="cx"> textMatchElement = carddavxml.TextMatch.fromString(resource_name[:-4])
</span><span class="cx"> textMatchElement.attributes["match-type"] = "equals" # do equals compare. Default is "contains"
</span><span class="cx"> vCardFilters.append(carddavxml.PropertyFilter(
</span><del>- textMatchElement,
- name="UID", # attributes
- ))
</del><ins>+ textMatchElement,
+ name="UID", # attributes
+ ))
</ins><span class="cx"> else:
</span><span class="cx"> responses.append(davxml.StatusResponse(href, davxml.Status.fromResponseCode(responsecode.NOT_FOUND)))
</span><span class="cx">
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx"> addressBookFilter = carddavxml.Filter(*vCardFilters)
</span><span class="cx"> addressBookFilter = Filter(addressBookFilter)
</span><span class="cx">
</span><del>- #get vCards and filter
</del><ins>+ # get vCards and filter
</ins><span class="cx"> limit = config.DirectoryAddressBook.MaxQueryResults
</span><span class="cx"> results, limited = (yield self.doAddressBookDirectoryQuery(addressBookFilter, propertyreq, limit, defaultKind=None))
</span><span class="cx"> if limited:
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavnotificationspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/notifications.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/notifications.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/notifications.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx">
</span><span class="cx"> import json
</span><span class="cx"> import os
</span><del>-import types
</del><span class="cx">
</span><span class="cx"> log = Logger()
</span><span class="cx">
</span><span class="lines">@@ -172,7 +171,8 @@
</span><span class="cx">
</span><span class="cx"> def addOrUpdateRecord(self, record):
</span><span class="cx">
</span><del>- self._db_execute("""insert or replace into NOTIFICATIONS (UID, NAME, TYPE)
</del><ins>+ self._db_execute(
+ """insert or replace into NOTIFICATIONS (UID, NAME, TYPE)
</ins><span class="cx"> values (:1, :2, :3)
</span><span class="cx"> """, record.uid, record.name, json.dumps(record.notificationtype),
</span><span class="cx"> )
</span><span class="lines">@@ -328,4 +328,6 @@
</span><span class="cx">
</span><span class="cx"> def _makeRecord(self, row):
</span><span class="cx">
</span><del>- return NotificationRecord(*[str(item) if type(item) == types.UnicodeType else item for item in row])
</del><ins>+ return NotificationRecord(
+ *[str(item) if isinstance(item, unicode) else item for item in row]
+ )
</ins></span></pre></div>
<a id="CalendarServertrunktwistedcaldavresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/resource.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/resource.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/resource.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -425,10 +425,10 @@
</span><span class="cx"> # These are "live" properties in the sense of WebDAV, however "live" for twext actually means
</span><span class="cx"> # ones that are also always present, but the default alarm properties are allowed to be absent
</span><span class="cx"> # and are in fact stored in the property store.
</span><del>- #caldavxml.DefaultAlarmVEventDateTime.qname(),
- #caldavxml.DefaultAlarmVEventDate.qname(),
- #caldavxml.DefaultAlarmVToDoDateTime.qname(),
- #caldavxml.DefaultAlarmVToDoDate.qname(),
</del><ins>+ # caldavxml.DefaultAlarmVEventDateTime.qname(),
+ # caldavxml.DefaultAlarmVEventDate.qname(),
+ # caldavxml.DefaultAlarmVToDoDateTime.qname(),
+ # caldavxml.DefaultAlarmVToDoDate.qname(),
</ins><span class="cx">
</span><span class="cx"> customxml.PubSubXMPPPushKeyProperty.qname(),
</span><span class="cx"> )
</span><span class="lines">@@ -1414,9 +1414,9 @@
</span><span class="cx"> raise HTTPError(StatusResponse(responsecode.NOT_ALLOWED, "File exists"))
</span><span class="cx">
</span><span class="cx"> # newStore guarantees that we always have a parent calendar home
</span><del>- #if not self.fp.parent().isdir():
- # log.error("Attempt to create collection with no parent: %s" % (self.fp.path,))
- # raise HTTPError(StatusResponse(responsecode.CONFLICT, "No parent collection"))
</del><ins>+ # if not self.fp.parent().isdir():
+ # log.error("Attempt to create collection with no parent: %s" % (self.fp.path,))
+ # raise HTTPError(StatusResponse(responsecode.CONFLICT, "No parent collection"))
</ins><span class="cx">
</span><span class="cx"> #
</span><span class="cx"> # Verify that no parent collection is a calendar also
</span><span class="lines">@@ -1503,9 +1503,9 @@
</span><span class="cx"> raise HTTPError(StatusResponse(responsecode.NOT_ALLOWED, "File exists"))
</span><span class="cx">
</span><span class="cx"> # newStore guarantees that we always have a parent calendar home
</span><del>- #if not os.path.isdir(os.path.dirname(self.fp.path)):
- # log.error("Attempt to create collection with no parent: %s" % (self.fp.path,))
- # raise HTTPError(StatusResponse(responsecode.CONFLICT, "No parent collection"))
</del><ins>+ # if not os.path.isdir(os.path.dirname(self.fp.path)):
+ # log.error("Attempt to create collection with no parent: %s" % (self.fp.path,))
+ # raise HTTPError(StatusResponse(responsecode.CONFLICT, "No parent collection"))
</ins><span class="cx">
</span><span class="cx"> #
</span><span class="cx"> # Verify that no parent collection is a calendar also
</span><span class="lines">@@ -1881,7 +1881,7 @@
</span><span class="cx"> if name == "addressbook-home-set":
</span><span class="cx"> returnValue(carddavxml.AddressBookHomeSet(
</span><span class="cx"> *[element.HRef(abhome_url) for abhome_url in self.addressBookHomeURLs()]
</span><del>- ))
</del><ins>+ ))
</ins><span class="cx"> elif name == "directory-gateway" and self.directoryAddressBookEnabled():
</span><span class="cx"> returnValue(carddavxml.DirectoryGateway(
</span><span class="cx"> element.HRef.fromString(joinURL("/", config.DirectoryAddressBook.name, "/"))
</span><span class="lines">@@ -2289,8 +2289,10 @@
</span><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="cx"> elif qname == (customxml.calendarserver_namespace, "pushkey"):
</span><del>- if (config.Notifications.Services.AMP.Enabled or
- config.Notifications.Services.APNS.Enabled):
</del><ins>+ if (
+ config.Notifications.Services.AMP.Enabled or
+ config.Notifications.Services.APNS.Enabled
+ ):
</ins><span class="cx"> notifier = self._newStoreHome.getNotifier("push")
</span><span class="cx"> if notifier is not None:
</span><span class="cx"> returnValue(customxml.PubSubXMPPPushKeyProperty(notifier.nodeName()))
</span><span class="lines">@@ -2429,10 +2431,10 @@
</span><span class="cx"> # These are "live" properties in the sense of WebDAV, however "live" for twext actually means
</span><span class="cx"> # ones that are also always present, but the default alarm properties are allowed to be absent
</span><span class="cx"> # and are in fact stored in the property store.
</span><del>- #caldavxml.DefaultAlarmVEventDateTime.qname(),
- #caldavxml.DefaultAlarmVEventDate.qname(),
- #caldavxml.DefaultAlarmVToDoDateTime.qname(),
- #caldavxml.DefaultAlarmVToDoDate.qname(),
</del><ins>+ # caldavxml.DefaultAlarmVEventDateTime.qname(),
+ # caldavxml.DefaultAlarmVEventDate.qname(),
+ # caldavxml.DefaultAlarmVToDoDateTime.qname(),
+ # caldavxml.DefaultAlarmVToDoDate.qname(),
</ins><span class="cx">
</span><span class="cx"> )
</span><span class="cx">
</span><span class="lines">@@ -2928,19 +2930,27 @@
</span><span class="cx"> """ AuthenticationWrapper implementation which allows overriding
</span><span class="cx"> credentialFactories on a per-resource-path basis """
</span><span class="cx">
</span><del>- def __init__(self, resource, portal,
</del><ins>+ def __init__(
+ self, resource, portal,
</ins><span class="cx"> wireEncryptedCredentialFactories, wireUnencryptedCredentialFactories,
</span><del>- loginInterfaces, overrides=None):
</del><ins>+ loginInterfaces, overrides=None
+ ):
</ins><span class="cx">
</span><del>- super(AuthenticationWrapper, self).__init__(resource, portal,
</del><ins>+ super(AuthenticationWrapper, self).__init__(
+ resource, portal,
</ins><span class="cx"> wireEncryptedCredentialFactories, wireUnencryptedCredentialFactories,
</span><del>- loginInterfaces)
</del><ins>+ loginInterfaces
+ )
</ins><span class="cx">
</span><span class="cx"> self.overrides = {}
</span><span class="cx"> if overrides:
</span><span class="cx"> for path, factories in overrides.iteritems():
</span><del>- self.overrides[path] = dict([(factory.scheme, factory)
- for factory in factories])
</del><ins>+ self.overrides[path] = dict(
+ [
+ (factory.scheme, factory)
+ for factory in factories
+ ]
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def hook(self, req):
</span><span class="lines">@@ -2949,8 +2959,10 @@
</span><span class="cx">
</span><span class="cx"> super(AuthenticationWrapper, self).hook(req)
</span><span class="cx">
</span><del>- factories = self.overrides.get(req.path.rstrip("/"),
- req.credentialFactories)
</del><ins>+ factories = self.overrides.get(
+ req.path.rstrip("/"),
+ req.credentialFactories
+ )
</ins><span class="cx"> req.credentialFactories = factories
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavscheduling_storecaldavresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/scheduling_store/caldav/resource.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/scheduling_store/caldav/resource.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/scheduling_store/caldav/resource.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -154,6 +154,7 @@
</span><span class="cx"> customxml.CalendarAvailability.qname(),
</span><span class="cx"> )
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def resourceType(self):
</span><span class="cx"> return davxml.ResourceType.scheduleInbox
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstorebridgepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/storebridge.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/storebridge.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/storebridge.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -59,8 +59,8 @@
</span><span class="cx"> TooManyAttendeesError, InvalidCalendarAccessError, ValidOrganizerError,
</span><span class="cx"> InvalidPerUserDataMerge,
</span><span class="cx"> AttendeeAllowedError, ResourceDeletedError, InvalidAttachmentOperation,
</span><del>- ShareeAllowedError, DuplicatePrivateCommentsError, InvalidSplit
-, AttachmentSizeTooLarge, UnknownTimezone)
</del><ins>+ ShareeAllowedError, DuplicatePrivateCommentsError, InvalidSplit,
+ AttachmentSizeTooLarge, UnknownTimezone)
</ins><span class="cx"> from txdav.carddav.iaddressbookstore import (
</span><span class="cx"> KindChangeNotAllowedError, GroupWithUnsharedAddressNotAllowedError
</span><span class="cx"> )
</span><span class="lines">@@ -836,7 +836,7 @@
</span><span class="cx"> except HTTPError, e:
</span><span class="cx"> hasPrivilege = e
</span><span class="cx">
</span><del>- #get components
</del><ins>+ # get components
</ins><span class="cx"> indexedComponents = []
</span><span class="cx"> for index, xmldata in crudCreateInfo:
</span><span class="cx">
</span><span class="lines">@@ -918,12 +918,12 @@
</span><span class="cx"> )
</span><span class="cx"> else:
</span><span class="cx"> xmlresponses[index] = davxml.StatusResponse(
</span><del>- davxml.HRef.fromString(href),
- davxml.Status.fromResponseCode(code),
- davxml.Error(
- WebDAVUnknownElement.withName(*error),
- ) if error else None,
- )
</del><ins>+ davxml.HRef.fromString(href),
+ davxml.Status.fromResponseCode(code),
+ davxml.Error(
+ WebDAVUnknownElement.withName(*error),
+ ) if error else None,
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -2659,8 +2659,10 @@
</span><span class="cx"> homeUID = ownerHome.uid()
</span><span class="cx"> txn = ownerHome.transaction().store().newTransaction(
</span><span class="cx"> "new transaction for %s, doing: %s" % (self._newStoreObject.name(), label,))
</span><del>- newParent = (yield (yield txn.calendarHomeWithUID(homeUID))
- .calendarWithName(calendarName))
</del><ins>+ newParent = (
+ yield (yield txn.calendarHomeWithUID(homeUID))
+ .calendarWithName(calendarName)
+ )
</ins><span class="cx"> newObject = (yield newParent.calendarObjectWithName(objectName))
</span><span class="cx"> request._newStoreTransaction = txn
</span><span class="cx"> request._resourcesByURL.clear()
</span><span class="lines">@@ -3323,8 +3325,8 @@
</span><span class="cx"> call super and provision group share
</span><span class="cx"> """
</span><span class="cx"> abObjectResource = yield super(AddressBookCollectionResource, self).makeChild(name)
</span><del>- #if abObjectResource.exists() and abObjectResource._newStoreObject.shareUID() is not None:
- # abObjectResource = yield self.parentResource().provisionShare(abObjectResource)
</del><ins>+ # if abObjectResource.exists() and abObjectResource._newStoreObject.shareUID() is not None:
+ # abObjectResource = yield self.parentResource().provisionShare(abObjectResource)
</ins><span class="cx"> returnValue(abObjectResource)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -3434,7 +3436,7 @@
</span><span class="cx"> if ifmatch and ifmatch != etag.generate():
</span><span class="cx"> raise HTTPError(PRECONDITION_FAILED)
</span><span class="cx">
</span><del>- #===========================================================
</del><ins>+ # ===========================================================
</ins><span class="cx"> # # If unshared is allowed deletes fails but crud adds works work!
</span><span class="cx"> # if (hasPrivilege is not True and not (
</span><span class="cx"> # deleteResource.isShareeResource() or
</span><span class="lines">@@ -3442,11 +3444,13 @@
</span><span class="cx"> # )
</span><span class="cx"> # ):
</span><span class="cx"> # raise hasPrivilege
</span><del>- #===========================================================
</del><ins>+ # ===========================================================
</ins><span class="cx">
</span><span class="cx"> # don't allow shared group deletion -> unshare
</span><del>- if (deleteResource.isShareeResource() or
- deleteResource._newStoreObject.isGroupForSharedAddressBook()):
</del><ins>+ if (
+ deleteResource.isShareeResource() or
+ deleteResource._newStoreObject.isGroupForSharedAddressBook()
+ ):
</ins><span class="cx"> raise HTTPError(FORBIDDEN)
</span><span class="cx">
</span><span class="cx"> if hasPrivilege is not True:
</span><span class="lines">@@ -3675,8 +3679,10 @@
</span><span class="cx"> """
</span><span class="cx"> Override http_DELETE handle shared group deletion without fromParent=[davxml.Unbind()]
</span><span class="cx"> """
</span><del>- if (self.isShareeResource() or
- self.exists() and self._newStoreObject.isGroupForSharedAddressBook()):
</del><ins>+ if (
+ self.isShareeResource() or
+ self.exists() and self._newStoreObject.isGroupForSharedAddressBook()
+ ):
</ins><span class="cx"> returnValue((yield self.storeRemove(request)))
</span><span class="cx">
</span><span class="cx"> returnValue((yield super(AddressBookObjectResource, self).http_DELETE(request)))
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_addressbookmultigetpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_addressbookmultiget.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_addressbookmultiget.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_addressbookmultiget.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -146,8 +146,10 @@
</span><span class="cx"> status = propstat.childOfType(davxml.Status)
</span><span class="cx">
</span><span class="cx"> if status.code != responsecode.OK:
</span><del>- self.fail("REPORT failed (status %s) to locate properties: %r"
- % (status.code, href))
</del><ins>+ self.fail(
+ "REPORT failed (status %s) to locate properties: %r"
+ % (status.code, href)
+ )
</ins><span class="cx">
</span><span class="cx"> properties = propstat.childOfType(davxml.PropertyContainer).children
</span><span class="cx">
</span><span class="lines">@@ -187,8 +189,10 @@
</span><span class="cx"> status = response.childOfType(davxml.Status)
</span><span class="cx"> if status.code != responsecode.OK:
</span><span class="cx"> if href in okhrefs:
</span><del>- self.fail("REPORT failed (status %s) to locate properties: %r"
- % (status.code, href))
</del><ins>+ self.fail(
+ "REPORT failed (status %s) to locate properties: %r"
+ % (status.code, href)
+ )
</ins><span class="cx"> else:
</span><span class="cx"> if href in badhrefs:
</span><span class="cx"> badhrefs.remove(href)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_cachepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_cache.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_cache.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_cache.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -254,9 +254,10 @@
</span><span class="cx">
</span><span class="cx"> def test_getResponseForRequestNotInCache(self):
</span><span class="cx"> d = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/calendars/__uids__/dreid/',
- '/principals/__uids__/dreid/'))
</del><ins>+ 'PROPFIND',
+ '/calendars/__uids__/dreid/',
+ '/principals/__uids__/dreid/'
+ ))
</ins><span class="cx">
</span><span class="cx"> d.addCallback(self.assertEquals, None)
</span><span class="cx"> return d
</span><span class="lines">@@ -264,9 +265,10 @@
</span><span class="cx">
</span><span class="cx"> def test_getResponseForRequestInCache(self):
</span><span class="cx"> d = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/calendars/__uids__/cdaboo/',
- '/principals/__uids__/cdaboo/'))
</del><ins>+ 'PROPFIND',
+ '/calendars/__uids__/cdaboo/',
+ '/principals/__uids__/cdaboo/'
+ ))
</ins><span class="cx">
</span><span class="cx"> d.addCallback(self.assertResponse, self.expected_response)
</span><span class="cx"> return d
</span><span class="lines">@@ -276,9 +278,10 @@
</span><span class="cx"> self.tokens['/principals/__uids__/cdaboo/'] = 'principalToken1'
</span><span class="cx">
</span><span class="cx"> d = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/calendars/__uids__/cdaboo/',
- '/principals/__uids__/cdaboo/'))
</del><ins>+ 'PROPFIND',
+ '/calendars/__uids__/cdaboo/',
+ '/principals/__uids__/cdaboo/'
+ ))
</ins><span class="cx">
</span><span class="cx"> d.addCallback(self.assertEquals, None)
</span><span class="cx"> return d
</span><span class="lines">@@ -288,9 +291,10 @@
</span><span class="cx"> self.tokens['/calendars/__uids__/cdaboo/'] = 'uriToken1'
</span><span class="cx">
</span><span class="cx"> d = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/calendars/__uids__/cdaboo/',
- '/principals/__uids__/cdaboo/'))
</del><ins>+ 'PROPFIND',
+ '/calendars/__uids__/cdaboo/',
+ '/principals/__uids__/cdaboo/'
+ ))
</ins><span class="cx">
</span><span class="cx"> d.addCallback(self.assertEquals, None)
</span><span class="cx"> return d
</span><span class="lines">@@ -300,9 +304,10 @@
</span><span class="cx"> self.tokens['/calendars/__uids__/cdaboo/calendars/'] = 'childToken1'
</span><span class="cx">
</span><span class="cx"> d = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/calendars/__uids__/cdaboo/',
- '/principals/__uids__/cdaboo/'))
</del><ins>+ 'PROPFIND',
+ '/calendars/__uids__/cdaboo/',
+ '/principals/__uids__/cdaboo/'
+ ))
</ins><span class="cx">
</span><span class="cx"> d.addCallback(self.assertEquals, None)
</span><span class="cx"> return d
</span><span class="lines">@@ -310,10 +315,11 @@
</span><span class="cx">
</span><span class="cx"> def test_getResponseForDepthZero(self):
</span><span class="cx"> d = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/calendars/__uids__/cdaboo/',
- '/principals/__uids__/cdaboo/',
- depth='0'))
</del><ins>+ 'PROPFIND',
+ '/calendars/__uids__/cdaboo/',
+ '/principals/__uids__/cdaboo/',
+ depth='0'
+ ))
</ins><span class="cx">
</span><span class="cx"> d.addCallback(self.assertEquals, None)
</span><span class="cx"> return d
</span><span class="lines">@@ -321,10 +327,11 @@
</span><span class="cx">
</span><span class="cx"> def test_getResponseForBody(self):
</span><span class="cx"> d = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/calendars/__uids__/cdaboo/',
- '/principals/__uids__/cdaboo/',
- body='bazbax'))
</del><ins>+ 'PROPFIND',
+ '/calendars/__uids__/cdaboo/',
+ '/principals/__uids__/cdaboo/',
+ body='bazbax'
+ ))
</ins><span class="cx">
</span><span class="cx"> d.addCallback(self.assertEquals, None)
</span><span class="cx"> return d
</span><span class="lines">@@ -332,10 +339,11 @@
</span><span class="cx">
</span><span class="cx"> def test_getResponseForUnauthenticatedRequest(self):
</span><span class="cx"> d = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/calendars/__uids__/cdaboo/',
- '{DAV:}unauthenticated',
- body='bazbax'))
</del><ins>+ 'PROPFIND',
+ '/calendars/__uids__/cdaboo/',
+ '{DAV:}unauthenticated',
+ body='bazbax'
+ ))
</ins><span class="cx">
</span><span class="cx"> d.addCallback(self.assertEquals, None)
</span><span class="cx"> return d
</span><span class="lines">@@ -363,9 +371,10 @@
</span><span class="cx">
</span><span class="cx"> def _assertResponse(ign):
</span><span class="cx"> d1 = self.rc.getResponseForRequest(StubRequest(
</span><del>- 'PROPFIND',
- '/principals/__uids__/dreid/',
- '/principals/__uids__/dreid/'))
</del><ins>+ 'PROPFIND',
+ '/principals/__uids__/dreid/',
+ '/principals/__uids__/dreid/'
+ ))
</ins><span class="cx">
</span><span class="cx"> d1.addCallback(self.assertResponse,
</span><span class="cx"> (expected_response.code,
</span><span class="lines">@@ -374,9 +383,11 @@
</span><span class="cx"> return d1
</span><span class="cx">
</span><span class="cx"> d = self.rc.cacheResponseForRequest(
</span><del>- StubRequest('PROPFIND',
- '/principals/__uids__/dreid/',
- '/principals/__uids__/dreid/'),
</del><ins>+ StubRequest(
+ 'PROPFIND',
+ '/principals/__uids__/dreid/',
+ '/principals/__uids__/dreid/'
+ ),
</ins><span class="cx"> expected_response)
</span><span class="cx">
</span><span class="cx"> d.addCallback(_assertResponse)
</span><span class="lines">@@ -419,23 +430,27 @@
</span><span class="cx"> self.expected_response = (200, Headers({}), "Foo")
</span><span class="cx">
</span><span class="cx"> expected_key = hashlib.md5(':'.join([str(t) for t in (
</span><del>- 'PROPFIND',
- '/principals/__uids__/cdaboo/',
- '/calendars/__uids__/cdaboo/',
- '1',
- hash('foobar'),
- )])).hexdigest()
</del><ins>+ 'PROPFIND',
+ '/principals/__uids__/cdaboo/',
+ '/calendars/__uids__/cdaboo/',
+ '1',
+ hash('foobar'),
+ )])).hexdigest()
</ins><span class="cx">
</span><span class="cx"> memcacheStub._cache[expected_key] = (
</span><span class="cx"> 0, #flags
</span><span class="cx"> cPickle.dumps((
</span><del>- 'principalToken0',
- StubDirectoryRecord('cdaboo').cacheToken(),
- 'uriToken0',
- {'/calendars/__uids__/cdaboo/calendars/': 'childToken0'},
- (self.expected_response[0],
- dict(list(self.expected_response[1].getAllRawHeaders())),
- self.expected_response[2]))))
</del><ins>+ 'principalToken0',
+ StubDirectoryRecord('cdaboo').cacheToken(),
+ 'uriToken0',
+ {'/calendars/__uids__/cdaboo/calendars/': 'childToken0'},
+ (
+ self.expected_response[0],
+ dict(list(self.expected_response[1].getAllRawHeaders())),
+ self.expected_response[2]
+ )
+ ))
+ )
</ins><span class="cx">
</span><span class="cx"> self.memcacheStub = memcacheStub
</span><span class="cx">
</span><span class="lines">@@ -449,25 +464,29 @@
</span><span class="cx"> expected_response = (200, Headers({}), "Foobarbaz")
</span><span class="cx">
</span><span class="cx"> _key = (
</span><del>- 'PROPFIND',
- '/principals/__uids__/cdaboo/',
- '/calendars/users/cdaboo/',
- '1',
- hash('foobar'),
- )
</del><ins>+ 'PROPFIND',
+ '/principals/__uids__/cdaboo/',
+ '/calendars/users/cdaboo/',
+ '1',
+ hash('foobar'),
+ )
</ins><span class="cx">
</span><span class="cx"> expected_key = hashlib.md5(':'.join([str(t) for t in _key])).hexdigest()
</span><span class="cx">
</span><span class="cx"> self.memcacheStub._cache[expected_key] = (
</span><span class="cx"> 0, #flags
</span><span class="cx"> cPickle.dumps((
</span><del>- 'principalToken0',
- StubDirectoryRecord('cdaboo').cacheToken(),
- 'uriToken0',
- {'/calendars/__uids__/cdaboo/calendars/': 'childToken0'},
- (expected_response[0],
- dict(list(expected_response[1].getAllRawHeaders())),
- expected_response[2]))))
</del><ins>+ 'principalToken0',
+ StubDirectoryRecord('cdaboo').cacheToken(),
+ 'uriToken0',
+ {'/calendars/__uids__/cdaboo/calendars/': 'childToken0'},
+ (
+ expected_response[0],
+ dict(list(expected_response[1].getAllRawHeaders())),
+ expected_response[2]
+ )
+ ))
+ )
</ins><span class="cx">
</span><span class="cx"> d = self.rc.getResponseForRequest(
</span><span class="cx"> StubRequest('PROPFIND',
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_configpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_config.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_config.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_config.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -276,10 +276,10 @@
</span><span class="cx">
</span><span class="cx"> config.update({"DirectoryService": {"type": "twistedcaldav.test.test_config.SuperDuperAwesomeService"}})
</span><span class="cx">
</span><del>- #self.assertEquals(
- # config.DirectoryService.params,
- # SuperDuperAwesomeService.defaultParameters
- #)
</del><ins>+ # self.assertEquals(
+ # config.DirectoryService.params,
+ # SuperDuperAwesomeService.defaultParameters
+ # )
</ins><span class="cx">
</span><span class="cx"> testDirectoryService_unknownType.todo = "unimplemented"
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_icalendarpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_icalendar.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_icalendar.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_icalendar.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -74,16 +74,16 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_component_equality(self):
</span><del>-# for filename in (
-# os.path.join(self.data_dir, "Holidays", "C318A4BA-1ED0-11D9-A5E0-000A958A3252.ics"),
-# os.path.join(self.data_dir, "Holidays.ics"),
-# ):
-# data = file(filename).read()
-#
-# calendar1 = Component.fromString(data)
-# calendar2 = Component.fromString(data)
-#
-# self.assertEqual(calendar1, calendar2)
</del><ins>+ # for filename in (
+ # os.path.join(self.data_dir, "Holidays", "C318A4BA-1ED0-11D9-A5E0-000A958A3252.ics"),
+ # os.path.join(self.data_dir, "Holidays.ics"),
+ # ):
+ # data = file(filename).read()
+ #
+ # calendar1 = Component.fromString(data)
+ # calendar2 = Component.fromString(data)
+ #
+ # self.assertEqual(calendar1, calendar2)
</ins><span class="cx">
</span><span class="cx"> data1 = (
</span><span class="cx"> (
</span><span class="lines">@@ -334,7 +334,8 @@
</span><span class="cx">
</span><span class="cx"> # Fix it
</span><span class="cx"> calendar.validCalendarData(doFix=True)
</span><del>- self.assertTrue("RRULE:FREQ=DAILY;UNTIL=20110121T203000Z\r\n"
</del><ins>+ self.assertTrue(
+ "RRULE:FREQ=DAILY;UNTIL=20110121T203000Z\r\n"
</ins><span class="cx"> in str(calendar))
</span><span class="cx">
</span><span class="cx"> # Now it should pass without fixing
</span><span class="lines">@@ -536,14 +537,18 @@
</span><span class="cx"> self.fail("Shouldn't validate for CalDAV")
</span><span class="cx">
</span><span class="cx"> # Fix it
</span><del>- fixed, unfixed = calendar.validCalendarData(doFix=True,
</del><ins>+ fixed, unfixed = calendar.validCalendarData(
+ doFix=True,
</ins><span class="cx"> validateRecurrences=True)
</span><del>- self.assertEquals(fixed,
- ["Removed earlier EXDATE: 20120201T113000",
- "Removed earlier EXDATE: 20120202T113000",
- "Removed earlier EXDATE: 20120214T113000",
- "Removed earlier EXDATE: 20120215T113000",
- "Removed earlier EXDATE: 20120216T113000"]
</del><ins>+ self.assertEquals(
+ fixed,
+ [
+ "Removed earlier EXDATE: 20120201T113000",
+ "Removed earlier EXDATE: 20120202T113000",
+ "Removed earlier EXDATE: 20120214T113000",
+ "Removed earlier EXDATE: 20120215T113000",
+ "Removed earlier EXDATE: 20120216T113000"
+ ]
</ins><span class="cx"> )
</span><span class="cx"> self.assertEquals(unfixed, [])
</span><span class="cx">
</span><span class="lines">@@ -3524,7 +3529,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- ("X-ITEM2",),
</del><ins>+ ("X-ITEM2",),
</ins><span class="cx"> ),
</span><span class="cx"> (
</span><span class="cx"> "Non recurring - two properties",
</span><span class="lines">@@ -3567,7 +3572,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- ("X-ITEM2", "X-ITEM3",),
</del><ins>+ ("X-ITEM2", "X-ITEM3",),
</ins><span class="cx"> ),
</span><span class="cx"> (
</span><span class="cx"> "Non recurring - two properties - one overlap",
</span><span class="lines">@@ -3610,7 +3615,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- ("X-ITEM2", "X-ITEM1",),
</del><ins>+ ("X-ITEM2", "X-ITEM1",),
</ins><span class="cx"> ),
</span><span class="cx"> (
</span><span class="cx"> "Non recurring - one property",
</span><span class="lines">@@ -3679,7 +3684,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- ("X-ITEM2",),
</del><ins>+ ("X-ITEM2",),
</ins><span class="cx"> ),
</span><span class="cx"> (
</span><span class="cx"> "Non recurring - new override, one property",
</span><span class="lines">@@ -3740,7 +3745,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- ("X-ITEM2",),
</del><ins>+ ("X-ITEM2",),
</ins><span class="cx"> ),
</span><span class="cx"> )
</span><span class="cx">
</span><span class="lines">@@ -5298,7 +5303,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- 1, 0,
</del><ins>+ 1, 0,
</ins><span class="cx"> ),
</span><span class="cx"> (
</span><span class="cx"> "1.2 - valid with RDATE",
</span><span class="lines">@@ -5338,7 +5343,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- 0, 0,
</del><ins>+ 0, 0,
</ins><span class="cx"> ),
</span><span class="cx"> (
</span><span class="cx"> "2.1 - EXDATEd RECURRENCE-ID",
</span><span class="lines">@@ -5378,7 +5383,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- 1, 0,
</del><ins>+ 1, 0,
</ins><span class="cx"> ),
</span><span class="cx"> (
</span><span class="cx"> "2.2 - EXDATEd invalid RECURRENCE-ID",
</span><span class="lines">@@ -5419,7 +5424,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- 2, 0,
</del><ins>+ 2, 0,
</ins><span class="cx"> ),
</span><span class="cx"> (
</span><span class="cx"> "2.2 - EXDATEd RECURRENCE-ID with RDATE",
</span><span class="lines">@@ -5461,7 +5466,7 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><del>- 1, 0,
</del><ins>+ 1, 0,
</ins><span class="cx"> ),
</span><span class="cx"> )
</span><span class="cx">
</span><span class="lines">@@ -5673,8 +5678,6 @@
</span><span class="cx"> self.fail("Valid calendar should validate")
</span><span class="cx">
</span><span class="cx">
</span><del>-
-
</del><span class="cx"> def test_add_exdate(self):
</span><span class="cx"> data = ((
</span><span class="cx"> """BEGIN:VCALENDAR
</span><span class="lines">@@ -5804,9 +5807,9 @@
</span><span class="cx">
</span><span class="cx"> def test_perUserData(self):
</span><span class="cx"> data = (
</span><del>- (
- "No per-user, not recurring 1.1",
- """BEGIN:VCALENDAR
</del><ins>+ (
+ "No per-user, not recurring 1.1",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -5821,18 +5824,18 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (True, None, None,),),
- ),
- ),
</del><ins>+ ("", (True, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><del>- (
- "Single user, not recurring 1.2",
- """BEGIN:VCALENDAR
</del><ins>+ ),
+ ),
+ (
+ "Single user, not recurring 1.2",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -5858,19 +5861,19 @@
</span><span class="cx"> END:X-CALENDARSERVER-PERUSER
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ),
- ),
</del><ins>+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><del>- (
- "Two users, not recurring 1.3",
- """BEGIN:VCALENDAR
</del><ins>+ ),
+ ),
+ (
+ "Two users, not recurring 1.3",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -5903,20 +5906,20 @@
</span><span class="cx"> END:X-CALENDARSERVER-PERUSER
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ("user02", (True, None, None,),),
- ),
- ),
</del><ins>+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
+ ("user02", (True, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><del>- (
- "No per-user, simple recurring 2.1",
- """BEGIN:VCALENDAR
</del><ins>+ ),
+ ),
+ (
+ "No per-user, simple recurring 2.1",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -5931,24 +5934,24 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (False, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ),
- ),
</del><ins>+ ("", (False, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><span class="cx"> (
</span><del>- "Single user, simple recurring 2.2",
- """BEGIN:VCALENDAR
</del><ins>+ DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ),
+ ),
+ ),
+ ),
+ (
+ "Single user, simple recurring 2.2",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -5975,26 +5978,26 @@
</span><span class="cx"> END:X-CALENDARSERVER-PERUSER
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ),
- ),
</del><ins>+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><span class="cx"> (
</span><del>- "Two users, simple recurring 2.3",
- """BEGIN:VCALENDAR
</del><ins>+ DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
+ ),
+ ),
+ ),
+ ),
+ (
+ "Two users, simple recurring 2.3",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -6028,28 +6031,28 @@
</span><span class="cx"> END:X-CALENDARSERVER-PERUSER
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ("user02", (True, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ("user02", (True, None, None,),),
- ),
- ),
</del><ins>+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
+ ("user02", (True, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><span class="cx"> (
</span><del>- "No per-user, complex recurring 3.1",
- """BEGIN:VCALENDAR
</del><ins>+ DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
+ ("user02", (True, None, None,),),
+ ),
+ ),
+ ),
+ ),
+ (
+ "No per-user, complex recurring 3.1",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -6076,36 +6079,36 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (True, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 3, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (True, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 4, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (True, None, None,),),
- ),
- ),
</del><ins>+ ("", (True, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><span class="cx"> (
</span><del>- "Single user, complex recurring 3.2",
- """BEGIN:VCALENDAR
</del><ins>+ DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ),
+ ),
+ (
+ DateTime(2008, 6, 3, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (True, None, None,),),
+ ),
+ ),
+ (
+ DateTime(2008, 6, 4, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (True, None, None,),),
+ ),
+ ),
+ ),
+ ),
+ (
+ "Single user, complex recurring 3.2",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -6150,40 +6153,40 @@
</span><span class="cx"> END:X-CALENDARSERVER-PERUSER
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ("user01", (True, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 3, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ("user01", (True, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 4, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ),
- ),
</del><ins>+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><span class="cx"> (
</span><del>- "Two users, complex recurring 3.3",
- """BEGIN:VCALENDAR
</del><ins>+ DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ("user01", (True, None, None,),),
+ ),
+ ),
+ (
+ DateTime(2008, 6, 3, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ("user01", (True, None, None,),),
+ ),
+ ),
+ (
+ DateTime(2008, 6, 4, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
+ ),
+ ),
+ ),
+ ),
+ (
+ "Two users, complex recurring 3.3",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -6248,44 +6251,44 @@
</span><span class="cx"> END:X-CALENDARSERVER-PERUSER
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ("user02", (True, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ("user01", (True, None, None,),),
- ("user02", (False, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 3, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ("user01", (True, None, None,),),
- ("user02", (True, None, None,),),
- ),
- ),
- (
- DateTime(2008, 6, 4, 12, 0, 0, tzid=Timezone(utc=True)),
- (
- ("", (False, None, None,),),
- ("user01", (False, None, None,),),
- ("user02", (True, None, None,),),
- ),
- ),
</del><ins>+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
+ ("user02", (True, None, None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><span class="cx"> (
</span><del>- "Single user, with travel time 4.1",
- """BEGIN:VCALENDAR
</del><ins>+ DateTime(2008, 6, 2, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ("user01", (True, None, None,),),
+ ("user02", (False, None, None,),),
+ ),
+ ),
+ (
+ DateTime(2008, 6, 3, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ("user01", (True, None, None,),),
+ ("user02", (True, None, None,),),
+ ),
+ ),
+ (
+ DateTime(2008, 6, 4, 12, 0, 0, tzid=Timezone(utc=True)),
+ (
+ ("", (False, None, None,),),
+ ("user01", (False, None, None,),),
+ ("user02", (True, None, None,),),
+ ),
+ ),
+ ),
+ ),
+ (
+ "Single user, with travel time 4.1",
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="lines">@@ -6312,17 +6315,17 @@
</span><span class="cx"> END:X-CALENDARSERVER-PERUSER
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """.replace("\n", "\r\n"),
</span><ins>+ (
+ (
+ None,
</ins><span class="cx"> (
</span><del>- (
- None,
- (
- ("", (False, None, None,),),
- ("user01", (False, Duration(minutes=30), None,),),
- ),
- ),
</del><ins>+ ("", (False, None, None,),),
+ ("user01", (False, Duration(minutes=30), None,),),
</ins><span class="cx"> ),
</span><span class="cx"> ),
</span><del>- )
</del><ins>+ ),
+ ),
+ )
</ins><span class="cx">
</span><span class="cx"> for title, text, results in data:
</span><span class="cx"> calendar = Component.fromString(text)
</span><span class="lines">@@ -7331,8 +7334,9 @@
</span><span class="cx">
</span><span class="cx"> def test_hasInstancesAfter(self):
</span><span class="cx"> data = (
</span><del>- ("In the past (single)", False,
-"""BEGIN:VCALENDAR
</del><ins>+ (
+ "In the past (single)", False,
+ """BEGIN:VCALENDAR
</ins><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="cx"> PRODID:-//Apple Inc.//iCal 5.0.1//EN
</span><span class="lines">@@ -7366,8 +7370,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("In the past (repeating)", False,
-"""
</del><ins>+ (
+ "In the past (repeating)", False,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7414,8 +7419,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("Straddling (repeating)", True,
-"""
</del><ins>+ (
+ "Straddling (repeating)", True,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7462,8 +7468,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("Future (single)", True,
-"""
</del><ins>+ (
+ "Future (single)", True,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7498,8 +7505,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("Future (repeating)", True,
-"""
</del><ins>+ (
+ "Future (repeating)", True,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7546,8 +7554,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("On the day (single)", True,
-"""
</del><ins>+ (
+ "On the day (single)", True,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7582,8 +7591,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("Long non-all-day straddling (single)", True,
-"""
</del><ins>+ (
+ "Long non-all-day straddling (single)", True,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7618,8 +7628,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("All Day in the past (repeating)", False,
-"""
</del><ins>+ (
+ "All Day in the past (repeating)", False,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7638,8 +7649,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("Straddling All Day (repeating)", True,
-"""
</del><ins>+ (
+ "Straddling All Day (repeating)", True,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7658,8 +7670,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("Straddling All Day (single multiday)", True,
-"""
</del><ins>+ (
+ "Straddling All Day (single multiday)", True,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7677,8 +7690,9 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> """,
</span><span class="cx"> ),
</span><del>- ("Future All Day (single)", True,
-"""
</del><ins>+ (
+ "Future All Day (single)", True,
+ """
</ins><span class="cx"> BEGIN:VCALENDAR
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="lines">@@ -7746,26 +7760,30 @@
</span><span class="cx"> "Baz",
</span><span class="cx"> "baz",
</span><span class="cx"> "INDIVIDUAL",
</span><del>- ("urn:x-uid:baz", "urn:uuid:baz", "http://example.com/baz")
</del><ins>+ ("urn:x-uid:baz", "urn:uuid:baz", "http://example.com/baz")
</ins><span class="cx"> ),
</span><span class="cx"> "urn:x-uid:buz" : (
</span><span class="cx"> "Buz",
</span><span class="cx"> "buz",
</span><span class="cx"> "INDIVIDUAL",
</span><del>- ("urn:x-uid:buz", "urn:uuid:buz", "http://example.com/buz")
</del><ins>+ ("urn:x-uid:buz", "urn:uuid:buz", "http://example.com/buz")
</ins><span class="cx"> ),
</span><span class="cx"> }[cuaddr]
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> yield component.normalizeCalendarUserAddresses(lookupFunction, None, toCanonical=False)
</span><span class="cx">
</span><del>- self.assertEquals("mailto:bar@example.com",
</del><ins>+ self.assertEquals(
+ "mailto:bar@example.com",
</ins><span class="cx"> component.getAttendeeProperty(("mailto:bar@example.com",)).value())
</span><del>- self.assertEquals("/foo",
</del><ins>+ self.assertEquals(
+ "/foo",
</ins><span class="cx"> component.getAttendeeProperty(("/foo",)).value())
</span><del>- self.assertEquals("http://example.com/baz",
</del><ins>+ self.assertEquals(
+ "http://example.com/baz",
</ins><span class="cx"> component.getAttendeeProperty(("http://example.com/baz",)).value())
</span><del>- self.assertEquals("http://example.com/buz",
</del><ins>+ self.assertEquals(
+ "http://example.com/buz",
</ins><span class="cx"> component.getAttendeeProperty(("http://example.com/buz",)).value())
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_localizationpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_localization.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_localization.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_localization.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -66,7 +66,8 @@
</span><span class="cx">
</span><span class="cx"> self.assertEquals(_("All day"), "Allway ayday")
</span><span class="cx">
</span><del>- self.assertEquals(_("%(startTime)s to %(endTime)s") %
</del><ins>+ self.assertEquals(
+ _("%(startTime)s to %(endTime)s") %
</ins><span class="cx"> {'startTime': 'a', 'endTime': 'b'},
</span><span class="cx"> "a otay b"
</span><span class="cx"> )
</span><span class="lines">@@ -100,35 +101,43 @@
</span><span class="cx">
</span><span class="cx"> comp = data[0][1]
</span><span class="cx"> self.assertEquals(t.date(comp), "Saturday, October 25, 2008")
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'9:15 AM to 10:15 AM (PDT)', u'1 hour 1 second'))
</span><span class="cx">
</span><span class="cx"> comp = data[1][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'1:15 PM to 3:15 PM (PDT)', u'2 hours 2 seconds'))
</span><span class="cx">
</span><span class="cx"> comp = data[2][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'11:05 AM to 2:15 PM (PDT)', u'3 hours 10 minutes'))
</span><span class="cx">
</span><span class="cx"> comp = data[3][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> ("", u'All day'))
</span><span class="cx">
</span><span class="cx"> comp = data[4][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'1:15 PM (PDT)', ""))
</span><span class="cx">
</span><span class="cx"> comp = data[5][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'11:05 AM (PDT) to 6:15 PM (EDT)', u'4 hours 10 minutes'))
</span><span class="cx">
</span><span class="cx"> comp = data[6][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'11:05 AM to 5:15 PM (PDT)', u'1 day 6 hours 10 minutes'))
</span><span class="cx">
</span><span class="cx"> comp = data[7][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'11:05 AM to 12:15 PM (PDT)', u'2 days 1 hour 10 minutes'))
</span><span class="cx">
</span><span class="cx"> self.assertEquals(t.monthAbbreviation(1), "JAN")
</span><span class="lines">@@ -137,35 +146,43 @@
</span><span class="cx">
</span><span class="cx"> comp = data[0][1]
</span><span class="cx"> self.assertEquals(t.date(comp), 'Aturdaysay, Octoberway 25, 2008')
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'09:15 otay 10:15 (PDT)', u'1 ourhay 1 econdsay'))
</span><span class="cx">
</span><span class="cx"> comp = data[1][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'13:15 otay 15:15 (PDT)', u'2 ourshay 2 econdsay'))
</span><span class="cx">
</span><span class="cx"> comp = data[2][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'11:05 otay 14:15 (PDT)', u'3 ourshay 10 inutesmay'))
</span><span class="cx">
</span><span class="cx"> comp = data[3][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> ("", u'Allway ayday'))
</span><span class="cx">
</span><span class="cx"> comp = data[4][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'13:15 (PDT)', ""))
</span><span class="cx">
</span><span class="cx"> comp = data[5][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'11:05 (PDT) otay 18:15 (EDT)', u'4 ourshay 10 inutesmay'))
</span><span class="cx">
</span><span class="cx"> comp = data[6][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'11:05 otay 17:15 (PDT)', u'1 ayday 6 ourshay 10 inutesmay'))
</span><span class="cx">
</span><span class="cx"> comp = data[7][1]
</span><del>- self.assertEquals(t.time(comp),
</del><ins>+ self.assertEquals(
+ t.time(comp),
</ins><span class="cx"> (u'11:05 otay 12:15 (PDT)', u'2 aysday 1 ourhay 10 inutesmay'))
</span><span class="cx">
</span><span class="cx"> self.assertEquals(t.monthAbbreviation(1), "ANJAY")
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_memcachepropspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_memcacheprops.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_memcacheprops.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_memcacheprops.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -125,7 +125,8 @@
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop1", value="val1"))
</span><span class="cx">
</span><span class="cx"> child2 = self.getColl().getChild("a")
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop1")).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop1")).value,
</ins><span class="cx"> "val1")
</span><span class="cx">
</span><span class="cx"> child2.deadProperties().set(StubProperty("ns1:", "prop1", value="val2"))
</span><span class="lines">@@ -133,7 +134,8 @@
</span><span class="cx"> # force memcache to be consulted (once per collection per request)
</span><span class="cx"> child1 = self.getColl().getChild("a")
</span><span class="cx">
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop1")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop1")).value,
</ins><span class="cx"> "val2")
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -144,11 +146,14 @@
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop2", value="val0"))
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop3", value="val0"))
</span><span class="cx">
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop1")).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop1")).value,
</ins><span class="cx"> "val0")
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop2")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop2")).value,
</ins><span class="cx"> "val0")
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop3")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop3")).value,
</ins><span class="cx"> "val0")
</span><span class="cx">
</span><span class="cx"> child2.deadProperties().set(StubProperty("ns1:", "prop1", value="val1"))
</span><span class="lines">@@ -158,18 +163,24 @@
</span><span class="cx"> child2 = self.getColl().getChild("a")
</span><span class="cx">
</span><span class="cx"> # verify properties
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop1")).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop1")).value,
</ins><span class="cx"> "val1")
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop2")).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop2")).value,
</ins><span class="cx"> "val0")
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop3")).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop3")).value,
</ins><span class="cx"> "val3")
</span><span class="cx">
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop1")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop1")).value,
</ins><span class="cx"> "val1")
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop2")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop2")).value,
</ins><span class="cx"> "val0")
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop3")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop3")).value,
</ins><span class="cx"> "val3")
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -180,11 +191,14 @@
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop2", value="val0"))
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop3", value="val0"))
</span><span class="cx">
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop1")).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop1")).value,
</ins><span class="cx"> "val0")
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop2")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop2")).value,
</ins><span class="cx"> "val0")
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop3")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop3")).value,
</ins><span class="cx"> "val0")
</span><span class="cx">
</span><span class="cx"> child2.deadProperties().set(StubProperty("ns1:", "prop1", value="val1"))
</span><span class="lines">@@ -192,9 +206,11 @@
</span><span class="cx"> self.assertRaises(HTTPError, child1.deadProperties().get, ("ns1:", "prop1"))
</span><span class="cx">
</span><span class="cx"> self.assertFalse(child1.deadProperties().contains(("ns1:", "prop1")))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop2")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop2")).value,
</ins><span class="cx"> "val0")
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop3")).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop3")).value,
</ins><span class="cx"> "val0")
</span><span class="cx">
</span><span class="cx"> # force memcache to be consulted (once per collection per request)
</span><span class="lines">@@ -202,9 +218,11 @@
</span><span class="cx">
</span><span class="cx"> # verify properties
</span><span class="cx"> self.assertFalse(child2.deadProperties().contains(("ns1:", "prop1")))
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop2")).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop2")).value,
</ins><span class="cx"> "val0")
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop3")).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop3")).value,
</ins><span class="cx"> "val0")
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -215,7 +233,8 @@
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop1", value="val1%s" % (uid if uid else "",)), uid=uid)
</span><span class="cx">
</span><span class="cx"> child2 = self.getColl().getChild("a")
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</ins><span class="cx"> "val1%s" % (uid if uid else "",))
</span><span class="cx">
</span><span class="cx"> child2.deadProperties().set(StubProperty("ns1:", "prop1", value="val2%s" % (uid if uid else "",)), uid=uid)
</span><span class="lines">@@ -223,7 +242,8 @@
</span><span class="cx"> # force memcache to be consulted (once per collection per request)
</span><span class="cx"> child1 = self.getColl().getChild("a")
</span><span class="cx">
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</ins><span class="cx"> "val2%s" % (uid if uid else "",))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -236,11 +256,14 @@
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop2", value="val0%s" % (uid if uid else "",)), uid=uid)
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop3", value="val0%s" % (uid if uid else "",)), uid=uid)
</span><span class="cx">
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><span class="cx">
</span><span class="cx"> child2.deadProperties().set(StubProperty("ns1:", "prop1", value="val1%s" % (uid if uid else "",)), uid=uid)
</span><span class="lines">@@ -250,18 +273,24 @@
</span><span class="cx"> child2 = self.getColl().getChild("a")
</span><span class="cx">
</span><span class="cx"> # verify properties
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</ins><span class="cx"> "val1%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</ins><span class="cx"> "val3%s" % (uid if uid else "",))
</span><span class="cx">
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</ins><span class="cx"> "val1%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</ins><span class="cx"> "val3%s" % (uid if uid else "",))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -274,11 +303,14 @@
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop2", value="val0%s" % (uid if uid else "",)), uid=uid)
</span><span class="cx"> child1.deadProperties().set(StubProperty("ns1:", "prop3", value="val0%s" % (uid if uid else "",)), uid=uid)
</span><span class="cx">
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop1"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><span class="cx">
</span><span class="cx"> child2.deadProperties().set(StubProperty("ns1:", "prop1", value="val1%s" % (uid if uid else "",)), uid=uid)
</span><span class="lines">@@ -286,9 +318,11 @@
</span><span class="cx"> self.assertRaises(HTTPError, child1.deadProperties().get, ("ns1:", "prop1"), uid=uid)
</span><span class="cx">
</span><span class="cx"> self.assertFalse(child1.deadProperties().contains(("ns1:", "prop1"), uid=uid))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child1.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child1.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><span class="cx">
</span><span class="cx"> # force memcache to be consulted (once per collection per request)
</span><span class="lines">@@ -296,9 +330,11 @@
</span><span class="cx">
</span><span class="cx"> # verify properties
</span><span class="cx"> self.assertFalse(child2.deadProperties().contains(("ns1:", "prop1"), uid=uid))
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop2"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><del>- self.assertEquals(child2.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</del><ins>+ self.assertEquals(
+ child2.deadProperties().get(("ns1:", "prop3"), uid=uid).value,
</ins><span class="cx"> "val0%s" % (uid if uid else "",))
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_mkcalendarpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx"> caldavxml.CalendarDescription("Calendar restricted to events."), # FIXME: lang=en
</span><span class="cx"> caldavxml.SupportedCalendarComponentSet(caldavxml.CalendarComponent(name="VEVENT")),
</span><span class="cx"> caldavxml.CalendarTimeZone(
</span><del>-"""BEGIN:VCALENDAR
</del><ins>+ """BEGIN:VCALENDAR
</ins><span class="cx"> PRODID:-//Example Corp.//CalDAV Client//EN
</span><span class="cx"> VERSION:2.0
</span><span class="cx"> BEGIN:VTIMEZONE
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_multigetpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_multiget.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_multiget.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_multiget.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -210,8 +210,9 @@
</span><span class="cx"> status = propstat.childOfType(davxml.Status)
</span><span class="cx">
</span><span class="cx"> if status.code != responsecode.OK:
</span><del>- self.fail("REPORT failed (status %s) to locate properties: %r"
- % (status.code, href))
</del><ins>+ self.fail(
+ "REPORT failed (status %s) to locate properties: %r"
+ % (status.code, href))
</ins><span class="cx">
</span><span class="cx"> properties = propstat.childOfType(davxml.PropertyContainer).children
</span><span class="cx">
</span><span class="lines">@@ -251,8 +252,9 @@
</span><span class="cx"> status = response.childOfType(davxml.Status)
</span><span class="cx"> if status.code != responsecode.OK:
</span><span class="cx"> if href in okhrefs:
</span><del>- self.fail("REPORT failed (status %s) to locate properties: %r"
- % (status.code, href))
</del><ins>+ self.fail(
+ "REPORT failed (status %s) to locate properties: %r"
+ % (status.code, href))
</ins><span class="cx"> else:
</span><span class="cx"> if href in badhrefs:
</span><span class="cx"> badhrefs.remove(href)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_wrappingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_wrapping.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_wrapping.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/test/test_wrapping.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -544,7 +544,7 @@
</span><span class="cx"> """
</span><span class="cx"> CR = "\n"
</span><span class="cx"> CRLF = "\r\n"
</span><del>- #validEvent = eventTemplate.format("", wsanchez=wsanchez, cdaboo=cdaboo).replace(CR, CRLF)
</del><ins>+ # validEvent = eventTemplate.format("", wsanchez=wsanchez, cdaboo=cdaboo).replace(CR, CRLF)
</ins><span class="cx"> invalidInstance = """
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:20060110T231240Z-4011c71-187-6f73
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavvcardpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/vcard.py (13817 => 13818)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/vcard.py        2014-08-01 17:40:13 UTC (rev 13817)
+++ CalendarServer/trunk/twistedcaldav/vcard.py        2014-08-01 17:59:51 UTC (rev 13818)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> values are (possibly empty) lists of parameter values.
</span><span class="cx"> """
</span><span class="cx"> if name is None:
</span><del>- assert value is None
</del><ins>+ assert value is None
</ins><span class="cx"> assert params is None
</span><span class="cx">
</span><span class="cx"> pyobj = kwargs["pycard"]
</span></span></pre>
</div>
</div>
</body>
</html>