<!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>[13599] 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/13599">13599</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-06-02 19:20:23 -0700 (Mon, 02 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Pyflakes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertoolscalverifypy">CalendarServer/trunk/calendarserver/tools/calverify.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsdashboardpy">CalendarServer/trunk/calendarserver/tools/dashboard.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsmigrate_verifypy">CalendarServer/trunk/calendarserver/tools/migrate_verify.py</a></li>
<li><a href="#CalendarServertrunkcontribtoolsmonitoranalysispy">CalendarServer/trunk/contrib/tools/monitoranalysis.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavmemcacheclientpy">CalendarServer/trunk/twistedcaldav/memcacheclient.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_icalendarpy">CalendarServer/trunk/twistedcaldav/test/test_icalendar.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavupgradepy">CalendarServer/trunk/twistedcaldav/upgrade.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingicaldiffpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py</a></li>
<li><a href="#CalendarServertrunktxdavcarddavdatastoresqlpy">CalendarServer/trunk/txdav/carddav/datastore/sql.py</a></li>
<li><a href="#CalendarServertrunktxweb2davmethodreport_expandpy">CalendarServer/trunk/txweb2/dav/method/report_expand.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarservertoolscalverifypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/calverify.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/calverify.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/calendarserver/tools/calverify.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> import sys
</span><span class="cx"> import time
</span><span class="cx"> import traceback
</span><del>-import uuid
</del><ins>+from uuid import uuid4
</ins><span class="cx"> 
</span><span class="cx"> from calendarserver.tools import tables
</span><span class="cx"> from calendarserver.tools.cmdline import utilityMain, WorkerService
</span><span class="lines">@@ -1851,7 +1851,7 @@
</span><span class="cx">                 _ignore_homeID, calendarID = yield self.getAllResourceInfoForResourceID(attresid)
</span><span class="cx">                 calendar = yield home.childWithID(calendarID)
</span><span class="cx">                 calendarObj = yield calendar.objectResourceWithID(attresid)
</span><del>-                calendarObj.scheduleTag = str(uuid.uuid4())
</del><ins>+                calendarObj.scheduleTag = str(uuid4())
</ins><span class="cx">                 yield calendarObj._setComponentInternal(attendee_calendar, internal_state=ComponentUpdateState.RAW)
</span><span class="cx">                 self.results.setdefault(&quot;Fix change event&quot;, set()).add((home.name(), calendar.name(), attendee_calendar.resourceUID(),))
</span><span class="cx"> 
</span><span class="lines">@@ -1862,7 +1862,7 @@
</span><span class="cx">                 defaultCalendar = (yield self.defaultCalendarForAttendee(home))
</span><span class="cx">                 if defaultCalendar is None:
</span><span class="cx">                     raise ValueError(&quot;Cannot find suitable default calendar&quot;)
</span><del>-                new_name = str(uuid.uuid4()) + &quot;.ics&quot;
</del><ins>+                new_name = str(uuid4()) + &quot;.ics&quot;
</ins><span class="cx">                 calendarObj = (yield defaultCalendar._createCalendarObjectWithNameInternal(new_name, attendee_calendar, internal_state=ComponentUpdateState.RAW, options=self.metadata))
</span><span class="cx">                 self.results.setdefault(&quot;Fix add event&quot;, set()).add((home.name(), defaultCalendar.name(), attendee_calendar.resourceUID(),))
</span><span class="cx"> 
</span><span class="lines">@@ -1879,7 +1879,7 @@
</span><span class="cx">             details[&quot;title&quot;] = instance.component.propertyValue(&quot;SUMMARY&quot;)
</span><span class="cx"> 
</span><span class="cx">             # Write new itip message to attendee inbox
</span><del>-            yield inbox.createCalendarObjectWithName(str(uuid.uuid4()) + &quot;.ics&quot;, itipmsg, options=self.metadata_inbox)
</del><ins>+            yield inbox.createCalendarObjectWithName(str(uuid4()) + &quot;.ics&quot;, itipmsg, options=self.metadata_inbox)
</ins><span class="cx">             self.results.setdefault(&quot;Fix add inbox&quot;, set()).add((home.name(), itipmsg.resourceUID(),))
</span><span class="cx"> 
</span><span class="cx">             yield self.txn.commit()
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsdashboardpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/dashboard.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/dashboard.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/calendarserver/tools/dashboard.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx">                     self.windows
</span><span class="cx">                 ):
</span><span class="cx">                     window.update()
</span><del>-        except Exception as e: #@UnusedVariable
</del><ins>+        except Exception:
</ins><span class="cx">             #print(str(e))
</span><span class="cx">             pass
</span><span class="cx">         if not self.usesCurses:
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsmigrate_verifypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/migrate_verify.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/migrate_verify.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/calendarserver/tools/migrate_verify.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx">                 self.badPaths.append(line)
</span><span class="cx"> 
</span><span class="cx">         # Remove any invalid GUIDs that actuall were valid
</span><del>-        invalidGUIDs = [guid for guid in invalidGUIDs if guid not in self.pathsByGUID]
</del><ins>+        invalidGUIDs = [pguid for pguid in invalidGUIDs if pguid not in self.pathsByGUID]
</ins><span class="cx"> 
</span><span class="cx">         self.output.write(&quot;\nTotal lines read: %d\n&quot; % (total,))
</span><span class="cx">         self.output.write(&quot;Total guids: valid: %d  invalid: %d  overall: %d\n&quot; % (
</span></span></pre></div>
<a id="CalendarServertrunkcontribtoolsmonitoranalysispy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/tools/monitoranalysis.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/contrib/tools/monitoranalysis.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/contrib/tools/monitoranalysis.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">     y2 = []
</span><span class="cx">     x3 = []
</span><span class="cx">     y3 = []
</span><del>-    for datetime, reqs, resp, lq, _ignore_cpu in data:
</del><ins>+    for _ignore_dt, reqs, resp, lq, _ignore_cpu in data:
</ins><span class="cx">         if lq == 0:
</span><span class="cx">             x1.append(reqs)
</span><span class="cx">             y1.append(resp)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx">     x = [[], [], [], []]
</span><span class="cx">     y = [[], [], [], []]
</span><del>-    for datetime, reqs, resp, _ignore_lq, cpu in data:
</del><ins>+    for _ignore_dt, reqs, resp, _ignore_lq, cpu in data:
</ins><span class="cx">         if cpu &gt; 75:
</span><span class="cx">             x[0].append(reqs)
</span><span class="cx">             y[0].append(resp)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavmemcacheclientpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/memcacheclient.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/memcacheclient.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/twistedcaldav/memcacheclient.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -1417,7 +1417,6 @@
</span><span class="cx">             print(&quot;FAIL&quot;, end=&quot;&quot;)
</span><span class="cx">         else:
</span><span class="cx">             print(&quot;OK&quot;, end=&quot;&quot;)
</span><del>-        import pickle
</del><span class="cx">         s = pickle.loads('V\\u4f1a\np0\n.')
</span><span class="cx">         try:
</span><span class="cx">             x = mc.set((s*SERVER_MAX_KEY_LENGTH).encode('utf-8'), 1)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_icalendarpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_icalendar.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_icalendar.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/twistedcaldav/test/test_icalendar.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -5235,8 +5235,8 @@
</span><span class="cx"> 
</span><span class="cx">         for title, calendar, tests in data:
</span><span class="cx">             ical = Component.fromString(calendar)
</span><del>-            rids = set([rid for rid, result in tests])
-            expected_results = set([rid for rid, result in tests if result == True])
</del><ins>+            rids = set([trid for trid, _ignore_tresult in tests])
+            expected_results = set([trid for trid, tresult in tests if tresult == True])
</ins><span class="cx">             actual_results = ical.validInstances(rids)
</span><span class="cx">             self.assertEqual(actual_results, expected_results, &quot;Failed comparison: %s %s&quot; % (title, actual_results,))
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/upgrade.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/upgrade.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/twistedcaldav/upgrade.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -775,7 +775,7 @@
</span><span class="cx"> 
</span><span class="cx">     if didUpdate:
</span><span class="cx">         property = caldavxml.CalendarFreeBusySet(
</span><del>-            *[element.HRef(href) for href in fbset]
</del><ins>+            *[element.HRef(fbhref) for fbhref in fbset]
</ins><span class="cx">         )
</span><span class="cx">         value = compress(property.toxml())
</span><span class="cx">         returnValue(value)
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingicaldiffpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -693,7 +693,7 @@
</span><span class="cx">         newexdates = set()
</span><span class="cx">         exdates = component.properties(&quot;EXDATE&quot;)
</span><span class="cx">         for exdate in exdates:
</span><del>-            newexdates.update([value.getValue().duplicate().adjustToUTC() for value in exdate.value()])
</del><ins>+            newexdates.update([exvalue.getValue().duplicate().adjustToUTC() for exvalue in exdate.value()])
</ins><span class="cx"> 
</span><span class="cx">         return timeRange.getStart(), timeRange.getEnd(), newdue, newrrules, newrdates, newexdates
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavcarddavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/carddav/datastore/sql.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/carddav/datastore/sql.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/txdav/carddav/datastore/sql.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -1165,12 +1165,12 @@
</span><span class="cx"> 
</span><span class="cx">         if ownerHomeToDataRowMap:
</span><span class="cx">             # Get property stores for all these child resources (if any found)
</span><del>-            addressbookPropertyStoreIDs = [ownerHome._addressbookPropertyStoreID for ownerHome in ownerHomeToDataRowMap]
</del><ins>+            addressbookPropertyStoreIDs = [ownerHomeItem._addressbookPropertyStoreID for ownerHomeItem in ownerHomeToDataRowMap]
</ins><span class="cx">             propertyStores = yield PropertyStore.forMultipleResourcesWithResourceIDs(
</span><span class="cx">                 home.uid(), home._txn, addressbookPropertyStoreIDs
</span><span class="cx">             )
</span><span class="cx"> 
</span><del>-            addressbookResourceIDs = [ownerHome.addressbook()._resourceID for ownerHome in ownerHomeToDataRowMap]
</del><ins>+            addressbookResourceIDs = [ownerHomeItem.addressbook()._resourceID for ownerHomeItem in ownerHomeToDataRowMap]
</ins><span class="cx">             revisions = yield cls._revisionsForResourceIDs(addressbookResourceIDs).on(home._txn, resourceIDs=addressbookResourceIDs)
</span><span class="cx">             revisions = dict(revisions)
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxweb2davmethodreport_expandpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txweb2/dav/method/report_expand.py (13598 => 13599)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txweb2/dav/method/report_expand.py        2014-06-03 01:12:14 UTC (rev 13598)
+++ CalendarServer/trunk/txweb2/dav/method/report_expand.py        2014-06-03 02:20:23 UTC (rev 13599)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> 
</span><span class="cx">     for property in expand_property.children:
</span><span class="cx">         namespace = property.attributes.get(&quot;namespace&quot;, dav_namespace)
</span><del>-        name      = property.attributes.get(&quot;name&quot;, &quot;&quot;)
</del><ins>+        name = property.attributes.get(&quot;name&quot;, &quot;&quot;)
</ins><span class="cx"> 
</span><span class="cx">         # Make sure children have no children
</span><span class="cx">         props_to_find = []
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">                     &quot;expand-property REPORT only supports single level expansion&quot;
</span><span class="cx">                 ))
</span><span class="cx">             child_namespace = child.attributes.get(&quot;namespace&quot;, dav_namespace)
</span><del>-            child_name      = child.attributes.get(&quot;name&quot;, &quot;&quot;)
</del><ins>+            child_name = child.attributes.get(&quot;name&quot;, &quot;&quot;)
</ins><span class="cx">             props_to_find.append((child_namespace, child_name))
</span><span class="cx"> 
</span><span class="cx">         properties[(namespace, name)] = props_to_find
</span><span class="lines">@@ -161,16 +161,17 @@
</span><span class="cx">             )
</span><span class="cx"> 
</span><span class="cx">             status = statusForFailure(f, &quot;getting property: %s&quot; % (qname,))
</span><del>-            if status not in properties_by_status: properties_by_status[status] = []
</del><ins>+            if status not in properties_by_status:
+                properties_by_status[status] = []
</ins><span class="cx">             properties_by_status[status].append(propertyName(qname))
</span><span class="cx"> 
</span><span class="cx">     # Build the overall response
</span><span class="cx">     propstats = [
</span><span class="cx">         element.PropertyStatus(
</span><del>-            element.PropertyContainer(*properties_by_status[status]),
-            element.Status.fromResponseCode(status)
</del><ins>+            element.PropertyContainer(*properties_by_status[pstatus]),
+            element.Status.fromResponseCode(pstatus)
</ins><span class="cx">         )
</span><del>-        for status in properties_by_status if properties_by_status[status]
</del><ins>+        for pstatus in properties_by_status if properties_by_status[pstatus]
</ins><span class="cx">     ]
</span><span class="cx"> 
</span><span class="cx">     returnValue(MultiStatusResponse((element.PropertyStatusResponse(element.HRef(request.uri), *propstats),)))
</span></span></pre>
</div>
</div>

</body>
</html>