[CalendarServer-changes] [3464] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Dec 5 09:36:54 PST 2008


Revision: 3464
          http://trac.macosforge.org/projects/calendarserver/changeset/3464
Author:   cdaboo at apple.com
Date:     2008-12-05 09:36:53 -0800 (Fri, 05 Dec 2008)
Log Message:
-----------
More Python 2.6 clean-up.

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.fileop.patch
    CalendarServer/trunk/twistedcaldav/extensions.py

Added Paths:
-----------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test.test_copy.patch

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.fileop.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.fileop.patch	2008-12-05 15:53:05 UTC (rev 3463)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.fileop.patch	2008-12-05 17:36:53 UTC (rev 3464)
@@ -10,3 +10,22 @@
  ]
  
  import os
+@@ -287,7 +288,7 @@
+                     response = waitForDeferred(copy(FilePath(source_path), FilePath(destination_path), destination_uri, depth))
+                     yield response
+                     response = response.getResult()
+-                    checkResponse(response, "copy", responsecode.NO_CONTENT)
++                    checkResponse(response, "copy", responsecode.CREATED, responsecode.NO_CONTENT)
+ 
+             for subdir in subdirs:
+                 source_path, destination_path = paths(dir, subdir)
+@@ -509,7 +510,5 @@
+     os.rmdir(dirname)
+ 
+ def checkResponse(response, method, *codes):
+-    assert (
+-        response in codes,
+-        "%s() should have raised, but returned one of %r instead" % (method, codes)
+-    )
++    assert  response in codes, \
++        "%s() returned %r, but should have returned one of %r instead" % (method, response, codes)

Added: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test.test_copy.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test.test_copy.patch	                        (rev 0)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test.test_copy.patch	2008-12-05 17:36:53 UTC (rev 3464)
@@ -0,0 +1,24 @@
+Index: twisted/web2/dav/test/test_copy.py
+===================================================================
+--- twisted/web2/dav/test/test_copy.py	(revision 19773)
++++ twisted/web2/dav/test/test_copy.py	(working copy)
+@@ -22,9 +22,9 @@
+ # DRI: Wilfredo Sanchez, wsanchez at apple.com
+ ##
+ 
++from hashlib import md5
+ import os
+ import urllib
+-import md5
+ 
+ import twisted.web2.dav.test.util
+ from twisted.web2 import responsecode
+@@ -161,7 +161,7 @@
+             yield (request, do_test)
+ 
+ def sumFile(path):
+-    m = md5.new()
++    m = md5()
+ 
+     if os.path.isfile(path):
+         f = file(path)

Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py	2008-12-05 15:53:05 UTC (rev 3463)
+++ CalendarServer/trunk/twistedcaldav/extensions.py	2008-12-05 17:36:53 UTC (rev 3464)
@@ -468,10 +468,8 @@
         principal = self.currentPrincipal(request)
 
         # Other principal types don't make sense as actors.
-        assert (
-            principal.children[0].name in ("unauthenticated", "href"),
+        assert principal.children[0].name in ("unauthenticated", "href"), \
             "Principal is not an actor: %r" % (principal,)
-        )
 
         acl = self.fullAccessControlList(acl, inherited_aces)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081205/69b81a1f/attachment.html>


More information about the calendarserver-changes mailing list