<!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>[5534] CalendarServer/branches/users/wsanchez/transations</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.macosforge.org/projects/calendarserver/changeset/5534">5534</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2010-04-27 12:03:13 -0700 (Tue, 27 Apr 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix comparison by adding .timetuple, per http://bugs.python.org/issue8005</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserswsancheztransationsconfauthaccountstestxml">CalendarServer/branches/users/wsanchez/transations/conf/auth/accounts-test.xml</a></li>
<li><a href="#CalendarServerbranchesuserswsancheztransationsconfauthaugmentstestxml">CalendarServer/branches/users/wsanchez/transations/conf/auth/augments-test.xml</a></li>
<li><a href="#CalendarServerbranchesuserswsancheztransationstest">CalendarServer/branches/users/wsanchez/transations/test</a></li>
<li><a href="#CalendarServerbranchesuserswsancheztransationstwextpythondatetimepy">CalendarServer/branches/users/wsanchez/transations/twext/python/datetime.py</a></li>
<li><a href="#CalendarServerbranchesuserswsancheztransationstwextpythontesttest_datetimepy">CalendarServer/branches/users/wsanchez/transations/twext/python/test/test_datetime.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserswsancheztransationsconfauthaccountstestxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/wsanchez/transations/conf/auth/accounts-test.xml (5533 => 5534)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/wsanchez/transations/conf/auth/accounts-test.xml        2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/conf/auth/accounts-test.xml        2010-04-27 19:03:13 UTC (rev 5534)
</span><span class="lines">@@ -35,6 +35,51 @@
</span><span class="cx">     &lt;first-name&gt;Apprentice&lt;/first-name&gt;
</span><span class="cx">     &lt;last-name&gt;Super User&lt;/last-name&gt;
</span><span class="cx">   &lt;/user&gt;
</span><ins>+  &lt;user&gt;
+    &lt;uid&gt;wsanchez&lt;/uid&gt;
+    &lt;guid&gt;wsanchez&lt;/guid&gt;
+    &lt;email-address&gt;wsanchez@apple.com&lt;/email-address&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Wilfredo Sanchez Vega&lt;/name&gt;
+    &lt;first-name&gt;Wilfredo&lt;/first-name&gt;
+    &lt;last-name&gt;Sanchez Vega&lt;/last-name&gt;
+  &lt;/user&gt;
+  &lt;user&gt;
+    &lt;uid&gt;cdaboo&lt;/uid&gt;
+    &lt;guid&gt;cdaboo&lt;/guid&gt;
+    &lt;email-address&gt;cdaboo@apple.com&lt;/email-address&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Cyrus Daboo&lt;/name&gt;
+    &lt;first-name&gt;Cyrus&lt;/first-name&gt;
+    &lt;last-name&gt;Daboo&lt;/last-name&gt;
+  &lt;/user&gt;
+  &lt;user&gt;
+    &lt;uid&gt;sagen&lt;/uid&gt;
+    &lt;guid&gt;sagen&lt;/guid&gt;
+    &lt;email-address&gt;sagen@apple.com&lt;/email-address&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Morgen Sagen&lt;/name&gt;
+    &lt;first-name&gt;Morgen&lt;/first-name&gt;
+    &lt;last-name&gt;Sagen&lt;/last-name&gt;
+  &lt;/user&gt;
+  &lt;user&gt;
+    &lt;uid&gt;dre&lt;/uid&gt;
+    &lt;guid&gt;andre&lt;/guid&gt;
+    &lt;email-address&gt;dre@apple.com&lt;/email-address&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Andre LaBranche&lt;/name&gt;
+    &lt;first-name&gt;Andre&lt;/first-name&gt;
+    &lt;last-name&gt;LaBranche&lt;/last-name&gt;
+  &lt;/user&gt;
+  &lt;user&gt;
+    &lt;uid&gt;glyph&lt;/uid&gt;
+    &lt;guid&gt;glyph&lt;/guid&gt;
+    &lt;email-address&gt;glyph@apple.com&lt;/email-address&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Glyph Lefkowitz&lt;/name&gt;
+    &lt;first-name&gt;Glyph&lt;/first-name&gt;
+    &lt;last-name&gt;Lefkowitz&lt;/last-name&gt;
+  &lt;/user&gt;
</ins><span class="cx">   &lt;user repeat=&quot;99&quot;&gt;
</span><span class="cx">     &lt;uid&gt;user%02d&lt;/uid&gt;
</span><span class="cx">     &lt;uid&gt;User %02d&lt;/uid&gt;
</span><span class="lines">@@ -102,4 +147,58 @@
</span><span class="cx">       &lt;member type=&quot;users&quot;&gt;user01&lt;/member&gt;
</span><span class="cx">     &lt;/members&gt;
</span><span class="cx">   &lt;/group&gt;
</span><ins>+  &lt;location&gt;
+    &lt;uid&gt;mercury&lt;/uid&gt;
+    &lt;guid&gt;mercury&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Mecury Conference Room, Building 1, 2nd Floor&lt;/name&gt;
+  &lt;/location&gt;
+  &lt;location&gt;
+    &lt;uid&gt;venus&lt;/uid&gt;
+    &lt;guid&gt;venus&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Venus Conference Room, Building 1, 2nd Floor&lt;/name&gt;
+  &lt;/location&gt;
+  &lt;location&gt;
+    &lt;uid&gt;Earth&lt;/uid&gt;
+    &lt;guid&gt;Earth&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Earth Conference Room, Building 1, 1st Floor&lt;/name&gt;
+  &lt;/location&gt;
+  &lt;location&gt;
+    &lt;uid&gt;mars&lt;/uid&gt;
+    &lt;guid&gt;mars&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Mars Conference Room, Building 1, 1st Floor&lt;/name&gt;
+  &lt;/location&gt;
+  &lt;location&gt;
+    &lt;uid&gt;jupiter&lt;/uid&gt;
+    &lt;guid&gt;jupiter&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Jupiter Conference Room, Building 2, 1st Floor&lt;/name&gt;
+  &lt;/location&gt;
+  &lt;location&gt;
+    &lt;uid&gt;neptune&lt;/uid&gt;
+    &lt;guid&gt;neptune&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Neptune Conference Room, Building 2, 1st Floor&lt;/name&gt;
+  &lt;/location&gt;
+  &lt;location&gt;
+    &lt;uid&gt;pluto&lt;/uid&gt;
+    &lt;guid&gt;pluto&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Pluto Conference Room, Building 2, 1st Floor&lt;/name&gt;
+  &lt;/location&gt;
+  &lt;location&gt;
+    &lt;uid&gt;saturn&lt;/uid&gt;
+    &lt;guid&gt;saturn&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Saturn Conference Room, Building 2, 1st Floor&lt;/name&gt;
+  &lt;/location&gt;
+  &lt;location&gt;
+    &lt;uid&gt;uranus&lt;/uid&gt;
+    &lt;guid&gt;uranus&lt;/guid&gt;
+    &lt;password&gt;demo&lt;/password&gt;
+    &lt;name&gt;Uranus Conference Room, Building 3, 1st Floor&lt;/name&gt;
+  &lt;/location&gt;
</ins><span class="cx"> &lt;/accounts&gt;
</span></span></pre></div>
<a id="CalendarServerbranchesuserswsancheztransationsconfauthaugmentstestxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/wsanchez/transations/conf/auth/augments-test.xml (5533 => 5534)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/wsanchez/transations/conf/auth/augments-test.xml        2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/conf/auth/augments-test.xml        2010-04-27 19:03:13 UTC (rev 5534)
</span><span class="lines">@@ -25,6 +25,38 @@
</span><span class="cx">     &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
</span><span class="cx">     &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
</span><span class="cx">   &lt;/record&gt;
</span><ins>+
+  &lt;record&gt;
+    &lt;uid&gt;wsanchez&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;glyph&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;sagen&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;dre&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;cdaboo&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+  &lt;/record&gt;
+
</ins><span class="cx">   &lt;record repeat=&quot;10&quot;&gt;
</span><span class="cx">     &lt;uid&gt;location%02d&lt;/uid&gt;
</span><span class="cx">     &lt;enable&gt;true&lt;/enable&gt;
</span></span></pre></div>
<a id="CalendarServerbranchesuserswsancheztransationstest"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/wsanchez/transations/test (5533 => 5534)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/wsanchez/transations/test        2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/test        2010-04-27 19:03:13 UTC (rev 5534)
</span><span class="lines">@@ -72,4 +72,4 @@
</span><span class="cx">     test_modules=&quot;calendarserver twistedcaldav twext txdav txcaldav txcarddav ${m_twisted}&quot;;
</span><span class="cx"> fi;
</span><span class="cx"> 
</span><del>-cd &quot;${wd}&quot; &amp;&amp; &quot;${python}&quot; &quot;${twisted}/bin/trial&quot; --rterrors ${random} ${until_fail} ${no_colour} ${coverage} ${test_modules};
</del><ins>+cd &quot;${wd}&quot; &amp;&amp; &quot;trial&quot; --rterrors ${random} ${until_fail} ${no_colour} ${coverage} ${test_modules};
</ins></span></pre></div>
<a id="CalendarServerbranchesuserswsancheztransationstwextpythondatetimepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/wsanchez/transations/twext/python/datetime.py (5533 => 5534)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/wsanchez/transations/twext/python/datetime.py        2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/twext/python/datetime.py        2010-04-27 19:03:13 UTC (rev 5534)
</span><span class="lines">@@ -136,6 +136,14 @@
</span><span class="cx">     def dateOrDatetime(self):
</span><span class="cx">         return self._dateOrDatetime
</span><span class="cx"> 
</span><ins>+    def timetuple(self):
+        #
+        # This is required to make comparison with datetimes work. See:
+        # http://bugs.python.org/issue8005
+        # http://docs.python.org/release/2.6.5/library/datetime.html#datetime.date.day
+        #
+        return self._dateOrDatetime.timetuple()
+
</ins><span class="cx">     def iCalendarString(self):
</span><span class="cx">         if self._isDatetime:
</span><span class="cx">             return dateTimeToString(self._dateOrDatetime)
</span></span></pre></div>
<a id="CalendarServerbranchesuserswsancheztransationstwextpythontesttest_datetimepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/wsanchez/transations/twext/python/test/test_datetime.py (5533 => 5534)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/wsanchez/transations/twext/python/test/test_datetime.py        2010-04-27 17:48:09 UTC (rev 5533)
+++ CalendarServer/branches/users/wsanchez/transations/twext/python/test/test_datetime.py        2010-04-27 19:03:13 UTC (rev 5534)
</span><span class="lines">@@ -46,6 +46,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class DatetimeTests(TestCase):
</span><ins>+    @testUnimplemented
+    def test_timetuple(self):
+        raise NotImplementedError()
+
</ins><span class="cx">     @timezones
</span><span class="cx">     def test_date_date(self, tz):
</span><span class="cx">         d = date.today()
</span><span class="lines">@@ -101,7 +105,7 @@
</span><span class="cx">         #
</span><span class="cx"> 
</span><span class="cx">         self.assertTrue (first        == base(first) )
</span><del>-       #self.assertTrue (base(first)  == first       ) # Bug in datetime
</del><ins>+        self.assertTrue (base(first)  == first       ) # Bug in datetime
</ins><span class="cx">         self.assertTrue (first        == base(first) )
</span><span class="cx">         self.assertTrue (first        != base(second))
</span><span class="cx">         self.assertTrue (base(first)  != second      )
</span><span class="lines">@@ -109,36 +113,36 @@
</span><span class="cx">         self.assertTrue (first        &lt;  second      )
</span><span class="cx">         self.assertTrue (second       &lt;  third       )
</span><span class="cx">         self.assertTrue (first        &lt;  base(second))
</span><del>-       #self.assertTrue (base(second) &lt;  third       ) # Bug in datetime
</del><ins>+        self.assertTrue (base(second) &lt;  third       ) # Bug in datetime
</ins><span class="cx">         self.assertTrue (first        &lt;  second      )
</span><span class="cx">         self.assertTrue (second       &lt;  third       )
</span><del>-       #self.assertTrue (base(first)  &lt;  second      )
</del><ins>+        self.assertTrue (base(first)  &lt;  second      )
</ins><span class="cx">         self.assertTrue (second       &lt;  base(third) ) # Bug in datetime
</span><span class="cx">         self.assertTrue (first        &lt;= second      )
</span><span class="cx">         self.assertTrue (second       &lt;= third       )
</span><span class="cx">         self.assertTrue (first        &lt;= base(second))
</span><del>-       #self.assertTrue (base(second) &lt;= third       ) # Bug in datetime
</del><ins>+        self.assertTrue (base(second) &lt;= third       ) # Bug in datetime
</ins><span class="cx">         self.assertTrue (first        &lt;= base(second))
</span><del>-       #self.assertTrue (base(second) &lt;= third       ) # Bug in datetime
</del><ins>+        self.assertTrue (base(second) &lt;= third       ) # Bug in datetime
</ins><span class="cx">         self.assertTrue (first        &lt;= second      )
</span><span class="cx">         self.assertTrue (second       &lt;= third       )
</span><del>-       #self.assertTrue (base(first)  &lt;= second      ) # Bug in datetime
</del><ins>+        self.assertTrue (base(first)  &lt;= second      ) # Bug in datetime
</ins><span class="cx">         self.assertTrue (second       &lt;= base(third) )
</span><span class="cx">         self.assertFalse(first        &gt;  second      )
</span><span class="cx">         self.assertFalse(second       &gt;  third       )
</span><span class="cx">         self.assertFalse(first        &gt;  base(second))
</span><del>-       #self.assertFalse(base(second) &gt;  third       ) # Bug in datetime
</del><ins>+        self.assertFalse(base(second) &gt;  third       ) # Bug in datetime
</ins><span class="cx">         self.assertFalse(first        &gt;  second      )
</span><span class="cx">         self.assertFalse(second       &gt;  third       )
</span><del>-       #self.assertFalse(base(first)  &gt;  second      ) # Bug in datetime
</del><ins>+        self.assertFalse(base(first)  &gt;  second      ) # Bug in datetime
</ins><span class="cx">         self.assertFalse(second       &gt;  base(third) )
</span><span class="cx">         self.assertFalse(first        &gt;= second      )
</span><span class="cx">         self.assertFalse(second       &gt;= third       )
</span><span class="cx">         self.assertFalse(first        &gt;= base(second))
</span><del>-       #self.assertFalse(base(second) &gt;= third       ) # Bug in datetime
</del><ins>+        self.assertFalse(base(second) &gt;= third       ) # Bug in datetime
</ins><span class="cx">         self.assertFalse(first        &gt;= second      )
</span><span class="cx">         self.assertFalse(second       &gt;= third       )
</span><del>-       #self.assertFalse(base(first)  &gt;= second      ) # Bug in datetime
</del><ins>+        self.assertFalse(base(first)  &gt;= second      ) # Bug in datetime
</ins><span class="cx">         self.assertFalse(second       &gt;= base(third) )
</span><span class="cx"> 
</span><span class="cx">     def test_date_iCalendarString(self):
</span><span class="lines">@@ -231,7 +235,7 @@
</span><span class="cx"> 
</span><span class="cx">     @testUnimplemented
</span><span class="cx">     def test_compare(self):
</span><del>-        raise NotImplemented
</del><ins>+        raise NotImplementedError()
</ins><span class="cx"> 
</span><span class="cx">     @featureUnimplemented
</span><span class="cx">     def test_overlapsWith(self):
</span></span></pre>
</div>
</div>

</body>
</html>