[CalendarServer-changes] [13599] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jun 2 19:20:23 PDT 2014
Revision: 13599
http://trac.calendarserver.org//changeset/13599
Author: cdaboo at apple.com
Date: 2014-06-02 19:20:23 -0700 (Mon, 02 Jun 2014)
Log Message:
-----------
Pyflakes.
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tools/calverify.py
CalendarServer/trunk/calendarserver/tools/dashboard.py
CalendarServer/trunk/calendarserver/tools/migrate_verify.py
CalendarServer/trunk/contrib/tools/monitoranalysis.py
CalendarServer/trunk/twistedcaldav/memcacheclient.py
CalendarServer/trunk/twistedcaldav/test/test_icalendar.py
CalendarServer/trunk/twistedcaldav/upgrade.py
CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py
CalendarServer/trunk/txdav/carddav/datastore/sql.py
CalendarServer/trunk/txweb2/dav/method/report_expand.py
Modified: CalendarServer/trunk/calendarserver/tools/calverify.py
===================================================================
--- 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)
@@ -44,7 +44,7 @@
import sys
import time
import traceback
-import uuid
+from uuid import uuid4
from calendarserver.tools import tables
from calendarserver.tools.cmdline import utilityMain, WorkerService
@@ -1851,7 +1851,7 @@
_ignore_homeID, calendarID = yield self.getAllResourceInfoForResourceID(attresid)
calendar = yield home.childWithID(calendarID)
calendarObj = yield calendar.objectResourceWithID(attresid)
- calendarObj.scheduleTag = str(uuid.uuid4())
+ calendarObj.scheduleTag = str(uuid4())
yield calendarObj._setComponentInternal(attendee_calendar, internal_state=ComponentUpdateState.RAW)
self.results.setdefault("Fix change event", set()).add((home.name(), calendar.name(), attendee_calendar.resourceUID(),))
@@ -1862,7 +1862,7 @@
defaultCalendar = (yield self.defaultCalendarForAttendee(home))
if defaultCalendar is None:
raise ValueError("Cannot find suitable default calendar")
- new_name = str(uuid.uuid4()) + ".ics"
+ new_name = str(uuid4()) + ".ics"
calendarObj = (yield defaultCalendar._createCalendarObjectWithNameInternal(new_name, attendee_calendar, internal_state=ComponentUpdateState.RAW, options=self.metadata))
self.results.setdefault("Fix add event", set()).add((home.name(), defaultCalendar.name(), attendee_calendar.resourceUID(),))
@@ -1879,7 +1879,7 @@
details["title"] = instance.component.propertyValue("SUMMARY")
# Write new itip message to attendee inbox
- yield inbox.createCalendarObjectWithName(str(uuid.uuid4()) + ".ics", itipmsg, options=self.metadata_inbox)
+ yield inbox.createCalendarObjectWithName(str(uuid4()) + ".ics", itipmsg, options=self.metadata_inbox)
self.results.setdefault("Fix add inbox", set()).add((home.name(), itipmsg.resourceUID(),))
yield self.txn.commit()
Modified: CalendarServer/trunk/calendarserver/tools/dashboard.py
===================================================================
--- 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)
@@ -201,7 +201,7 @@
self.windows
):
window.update()
- except Exception as e: #@UnusedVariable
+ except Exception:
#print(str(e))
pass
if not self.usesCurses:
Modified: CalendarServer/trunk/calendarserver/tools/migrate_verify.py
===================================================================
--- 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)
@@ -193,7 +193,7 @@
self.badPaths.append(line)
# Remove any invalid GUIDs that actuall were valid
- invalidGUIDs = [guid for guid in invalidGUIDs if guid not in self.pathsByGUID]
+ invalidGUIDs = [pguid for pguid in invalidGUIDs if pguid not in self.pathsByGUID]
self.output.write("\nTotal lines read: %d\n" % (total,))
self.output.write("Total guids: valid: %d invalid: %d overall: %d\n" % (
Modified: CalendarServer/trunk/contrib/tools/monitoranalysis.py
===================================================================
--- 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)
@@ -106,7 +106,7 @@
y2 = []
x3 = []
y3 = []
- for datetime, reqs, resp, lq, _ignore_cpu in data:
+ for _ignore_dt, reqs, resp, lq, _ignore_cpu in data:
if lq == 0:
x1.append(reqs)
y1.append(resp)
@@ -134,7 +134,7 @@
x = [[], [], [], []]
y = [[], [], [], []]
- for datetime, reqs, resp, _ignore_lq, cpu in data:
+ for _ignore_dt, reqs, resp, _ignore_lq, cpu in data:
if cpu > 75:
x[0].append(reqs)
y[0].append(resp)
Modified: CalendarServer/trunk/twistedcaldav/memcacheclient.py
===================================================================
--- 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)
@@ -1417,7 +1417,6 @@
print("FAIL", end="")
else:
print("OK", end="")
- import pickle
s = pickle.loads('V\\u4f1a\np0\n.')
try:
x = mc.set((s*SERVER_MAX_KEY_LENGTH).encode('utf-8'), 1)
Modified: CalendarServer/trunk/twistedcaldav/test/test_icalendar.py
===================================================================
--- 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)
@@ -5235,8 +5235,8 @@
for title, calendar, tests in data:
ical = Component.fromString(calendar)
- rids = set([rid for rid, result in tests])
- expected_results = set([rid for rid, result in tests if result == True])
+ rids = set([trid for trid, _ignore_tresult in tests])
+ expected_results = set([trid for trid, tresult in tests if tresult == True])
actual_results = ical.validInstances(rids)
self.assertEqual(actual_results, expected_results, "Failed comparison: %s %s" % (title, actual_results,))
Modified: CalendarServer/trunk/twistedcaldav/upgrade.py
===================================================================
--- 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)
@@ -775,7 +775,7 @@
if didUpdate:
property = caldavxml.CalendarFreeBusySet(
- *[element.HRef(href) for href in fbset]
+ *[element.HRef(fbhref) for fbhref in fbset]
)
value = compress(property.toxml())
returnValue(value)
Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py
===================================================================
--- 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)
@@ -693,7 +693,7 @@
newexdates = set()
exdates = component.properties("EXDATE")
for exdate in exdates:
- newexdates.update([value.getValue().duplicate().adjustToUTC() for value in exdate.value()])
+ newexdates.update([exvalue.getValue().duplicate().adjustToUTC() for exvalue in exdate.value()])
return timeRange.getStart(), timeRange.getEnd(), newdue, newrrules, newrdates, newexdates
Modified: CalendarServer/trunk/txdav/carddav/datastore/sql.py
===================================================================
--- 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)
@@ -1165,12 +1165,12 @@
if ownerHomeToDataRowMap:
# Get property stores for all these child resources (if any found)
- addressbookPropertyStoreIDs = [ownerHome._addressbookPropertyStoreID for ownerHome in ownerHomeToDataRowMap]
+ addressbookPropertyStoreIDs = [ownerHomeItem._addressbookPropertyStoreID for ownerHomeItem in ownerHomeToDataRowMap]
propertyStores = yield PropertyStore.forMultipleResourcesWithResourceIDs(
home.uid(), home._txn, addressbookPropertyStoreIDs
)
- addressbookResourceIDs = [ownerHome.addressbook()._resourceID for ownerHome in ownerHomeToDataRowMap]
+ addressbookResourceIDs = [ownerHomeItem.addressbook()._resourceID for ownerHomeItem in ownerHomeToDataRowMap]
revisions = yield cls._revisionsForResourceIDs(addressbookResourceIDs).on(home._txn, resourceIDs=addressbookResourceIDs)
revisions = dict(revisions)
Modified: CalendarServer/trunk/txweb2/dav/method/report_expand.py
===================================================================
--- 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)
@@ -69,7 +69,7 @@
for property in expand_property.children:
namespace = property.attributes.get("namespace", dav_namespace)
- name = property.attributes.get("name", "")
+ name = property.attributes.get("name", "")
# Make sure children have no children
props_to_find = []
@@ -81,7 +81,7 @@
"expand-property REPORT only supports single level expansion"
))
child_namespace = child.attributes.get("namespace", dav_namespace)
- child_name = child.attributes.get("name", "")
+ child_name = child.attributes.get("name", "")
props_to_find.append((child_namespace, child_name))
properties[(namespace, name)] = props_to_find
@@ -161,16 +161,17 @@
)
status = statusForFailure(f, "getting property: %s" % (qname,))
- if status not in properties_by_status: properties_by_status[status] = []
+ if status not in properties_by_status:
+ properties_by_status[status] = []
properties_by_status[status].append(propertyName(qname))
# Build the overall response
propstats = [
element.PropertyStatus(
- element.PropertyContainer(*properties_by_status[status]),
- element.Status.fromResponseCode(status)
+ element.PropertyContainer(*properties_by_status[pstatus]),
+ element.Status.fromResponseCode(pstatus)
)
- for status in properties_by_status if properties_by_status[status]
+ for pstatus in properties_by_status if properties_by_status[pstatus]
]
returnValue(MultiStatusResponse((element.PropertyStatusResponse(element.HRef(request.uri), *propstats),)))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140602/49123c45/attachment-0001.html>
More information about the calendarserver-changes
mailing list