[CalendarServer-changes] [8818] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 5 22:56:52 PST 2012


Revision: 8818
          http://trac.macosforge.org/projects/calendarserver/changeset/8818
Author:   glyph at apple.com
Date:     2012-03-05 22:56:51 -0800 (Mon, 05 Mar 2012)
Log Message:
-----------
Properly use CaseFold() rather than Lower() in calverify.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/calverify.py

Property Changed:
----------------
    CalendarServer/trunk/

Modified: CalendarServer/trunk/calendarserver/tools/calverify.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/calverify.py	2012-03-06 06:56:48 UTC (rev 8817)
+++ CalendarServer/trunk/calendarserver/tools/calverify.py	2012-03-06 06:56:51 UTC (rev 8818)
@@ -46,7 +46,7 @@
 from pycalendar.datetime import PyCalendarDateTime
 from pycalendar.exceptions import PyCalendarError
 from pycalendar.period import PyCalendarPeriod
-from twext.enterprise.dal.syntax import Select, Parameter, Count
+from twext.enterprise.dal.syntax import Select, Parameter, Count, CaseFold
 from twisted.application.service import Service
 from twisted.internet.defer import inlineCallbacks, returnValue, succeed
 from twisted.python import log
@@ -62,8 +62,8 @@
 import os
 import sys
 import time
-from twext.enterprise.dal.syntax import Lower
 
+
 def usage(e=None):
     if e:
         print e
@@ -267,7 +267,7 @@
                 cb, type="inner", on=(ch.RESOURCE_ID == cb.CALENDAR_HOME_RESOURCE_ID).And(
                     cb.BIND_MODE == _BIND_MODE_OWN)).join(
                 co, type="inner", on=(cb.CALENDAR_RESOURCE_ID == co.CALENDAR_RESOURCE_ID)),
-            Where=(ch.OWNER_UID == Lower(Parameter("UID")))
+            Where=(ch.OWNER_UID == CaseFold(Parameter("UID")))
         ).on(self.txn, **kwds))
         returnValue(int(rows[0][0]) if rows else 0)
 
@@ -340,7 +340,7 @@
                 cb, type="inner", on=(ch.RESOURCE_ID == cb.CALENDAR_HOME_RESOURCE_ID)).join(
                 co, type="inner", on=(cb.CALENDAR_RESOURCE_ID == co.CALENDAR_RESOURCE_ID).And(
                     cb.BIND_MODE == _BIND_MODE_OWN).And(
-                    cb.CALENDAR_RESOURCE_NAME != Lower("inbox"))),
+                    cb.CALENDAR_RESOURCE_NAME != "inbox")),
             GroupBy=(ch.OWNER_UID, co.RESOURCE_ID, co.ICALENDAR_UID, co.MD5, co.ORGANIZER,),
         ).on(self.txn, **kwds))
         returnValue(tuple(rows))
@@ -353,9 +353,9 @@
         ch = schema.CALENDAR_HOME
         kwds = {"uuid": uuid}
         if len(uuid) != 36:
-            where = (ch.OWNER_UID.StartsWith(Lower(Parameter("uuid"))))
+            where = (ch.OWNER_UID.StartsWith(CaseFold(Parameter("uuid"))))
         else:
-            where = (ch.OWNER_UID == Lower(Parameter("uuid")))
+            where = (ch.OWNER_UID == CaseFold(Parameter("uuid")))
         rows = (yield Select(
             [ch.OWNER_UID, co.RESOURCE_ID, co.ICALENDAR_UID, co.MD5, co.ORGANIZER,],
             From=ch.join(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120305/07e32183/attachment.html>


More information about the calendarserver-changes mailing list