[CalendarServer-changes] [169] CalendarServer/branches/users/cdaboo/quota/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Thu Sep 21 11:26:08 PDT 2006


Revision: 169
          http://trac.macosforge.org/projects/calendarserver/changeset/169
Author:   cdaboo at apple.com
Date:     2006-09-21 11:26:08 -0700 (Thu, 21 Sep 2006)

Log Message:
-----------
merge -r158:166 http://svn.opensource.apple.com/repository/calendarserver/CalendarServer/trunk .

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/directory.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/http.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/ical.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/itip.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_common.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/principalindex.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/repository.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/resource.py

Removed Paths:
-------------
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/constants.py

Deleted: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/constants.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/constants.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/constants.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -1,25 +0,0 @@
-##
-# Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# DRI: Cyrus Daboo, cdaboo at apple.com
-##
-
-"""
-Contsants used in various places.
-"""
-
-__version__ = "0.0"
-
-ICALENDAR_PRODID = "-//CALENDARSERVER.APPLE.COM//NONSGML Version 1//EN"

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/directory.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/directory.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/directory.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -301,9 +301,7 @@
     as needed.
     
     This includes a periodic task for refreshing the cached data.
-    
     """
-
     periodicSyncIntervalSeconds = 60.0
     
     typeUnknown  = 0
@@ -340,18 +338,18 @@
         self.index.check()
         self.calendarhomeroot = (homeuri, home)
 
-        """
-        There is a problem with the interaction of Directory Services and the
-        fork/fork process the server goes through to daemonize itself. For some
-        resaon, if DS is used before the fork, then calls to it afterwards all
-        return eServerSendError (-14740) errors.
-        
-        To get around this we must not use opendirectory module calls here, as this
-        method gets run before the fork/fork. So instead, we schedule a sync
-        operation to occur one second after the reactor starts up - which is after
-        the fork/fork. The problem with this is that the http server is already up
-        and running at that point BEFORE any initially provisioning is done.
-        """
+        #
+        # There is a problem with the interaction of Directory Services and the
+        # fork/fork process the server goes through to daemonize itself. For some
+        # resaon, if DS is used before the fork, then calls to it afterwards all
+        # return eServerSendError (-14740) errors.
+        # 
+        # To get around this we must not use opendirectory module calls here, as this
+        # method gets run before the fork/fork. So instead, we schedule a sync
+        # operation to occur one second after the reactor starts up - which is after
+        # the fork/fork. The problem with this is that the http server is already up
+        # and running at that point BEFORE any initially provisioning is done.
+        #
 
         # Create a periodic sync operation to keep the cached user list
         # in sync with the directory server.
@@ -415,7 +413,6 @@
         """
         Synchronize the data in the directory with the local cache of resources in the file system.
         """
-        
         #log.msg("Directory: Synchronizing cache for %s" % (self.getTitle(),))
 
         # Get index entries from directory and from cache
@@ -485,7 +482,6 @@
         @param attrs: C{dict} directory attributes for this name, or C{None} if attributes need to be read in.
         @param fast: if C{True} then final commit is not done, if C{False} commit is done.
         """
-        
         # This will create it
         child_fp = self.fp.child(name)
         assert not child_fp.exists()
@@ -508,7 +504,6 @@
         @param new: C{str} containing the name of the new resource.
         @param fast: if C{True} then final commit is not done, if C{False} commit is done.
         """
-        
         # Look for change to calendar enabled state
         
         # See if the name changed because that is a real pain!
@@ -534,7 +529,6 @@
         @param old: C{str} containing the name of the original resource.
         @param new: C{str} containing the name of the new resource.
         """
-
         log.msg("Directory: Renamed Principal %s to %s in %s" % (old, new, self.getTitle()))
         raise NotImplementedError
     
@@ -549,7 +543,6 @@
         @param new: C{True} when this update is the result of adding a new principal,
             C{False} otherwise.
         """
-        
         # Get attributes from directory
         if attrs is None:
             attrs = self.directoryAttributes(name)
@@ -699,7 +692,6 @@
         @param guid: the C{str} containing the GUID to match.
         @return: C{list} with matching principal URIs
         """
-        
         # Only both for group collections
         if self.type != DirectoryTypePrincipalProvisioningResource.typeGroup:
             return []

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/http.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/http.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/http.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -41,7 +41,7 @@
         @param xml_responses: an interable of davxml.Response objects.
         @param location:      the value of the location header to return in the response,
                               or None.
-         """
+        """
 
         Response.__init__(self, code=responsecode.OK,
                           stream=caldavxml.ScheduleResponse(*xml_responses).toxml())

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/ical.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/ical.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/ical.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -50,6 +50,8 @@
 from twistedcaldav.dateops import normalizeToUTC, timeRangesOverlap
 from twistedcaldav.instance import InstanceList
 
+iCalendarProductID = "-//CALENDARSERVER.APPLE.COM//NONSGML Version 1//EN"
+
 class Property (object):
     """
     iCalendar Property

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/itip.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/itip.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/itip.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -40,9 +40,8 @@
 from twisted.web2.dav.method.report import NumberOfMatchesWithinLimits
 from twisted.web2.dav.util import joinURL
 from twisted.web2.dav.fileop import delete
-from twistedcaldav import constants
 from twistedcaldav import caldavxml
-from twistedcaldav.ical import Property
+from twistedcaldav.ical import Property, iCalendarProductID
 from twistedcaldav.method import report_common
 from twistedcaldav.method.put_common import storeCalendarObjectResource
 from twistedcaldav.resource import CalendarPrincipalCollectionResource, isCalendarCollectionResource
@@ -523,7 +522,7 @@
     replycal.getProperty("METHOD").setValue("REPLY")
     
     # Change PRODID to this server
-    replycal.getProperty("PRODID").setValue(constants.ICALENDAR_PRODID)
+    replycal.getProperty("PRODID").setValue(iCalendarProductID)
     
     # Add REQUEST-STATUS
     if accepted:

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_common.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_common.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_common.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -41,11 +41,9 @@
 from twisted.web2.dav.util import joinURL
 
 from twistedcaldav import caldavxml
-from twistedcaldav import constants
 from twistedcaldav.caldavxml import caldav_namespace
 from twistedcaldav.dateops import clipPeriod, normalizePeriodList, timeRangesOverlap
-from twistedcaldav.ical import Component
-from twistedcaldav.ical import Property
+from twistedcaldav.ical import Component, Property, iCalendarProductID
 
 from vobject.icalendar import utc
 
@@ -481,7 +479,7 @@
     
     # Now build a new calendar object with the free busy info we have
     fbcalendar = Component("VCALENDAR")
-    fbcalendar.addProperty(Property("PRODID", constants.ICALENDAR_PRODID))
+    fbcalendar.addProperty(Property("PRODID", iCalendarProductID))
     fb = Component("VFREEBUSY")
     fbcalendar.addComponent(fb)
     if organizer is not None:

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/principalindex.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/principalindex.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/principalindex.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -31,14 +31,18 @@
 
 __version__ = "0.0"
 
-__all__ = ["UserIndex",
-           "GroupIndex",
-           "ResourceIndex"]
+__all__ = [
+    "UserIndex",
+    "GroupIndex",
+    "ResourceIndex",
+]
 
 schema_version = "1"
-collection_types = {"Users": "User Principals",
-                    "Groups": "Group Principals",
-                    "Resources": "Resource Principals"}
+collection_types = {
+    "Users"    : "User Principals",
+    "Groups"   : "Group Principals",
+    "Resources": "Resource Principals",
+}
 
 class PrincipalIndex(AbstractIndex):
     """

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/repository.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/repository.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/repository.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -158,7 +158,6 @@
         Parse the required information from an XML file.
         @param file: the path of the XML file to parse.
         """
-        
         # Read in XML
         fd = open(file, "r")
         doc = xml.dom.minidom.parse( fd )
@@ -194,8 +193,6 @@
     """
     Represents the hierarchy of resource collections that form the CalDAV repository.
     """
-    
-    
     def __init__(self, docroot):
         """
         @param docroot: the file system path for the root of the hierarchy.
@@ -224,7 +221,6 @@
         """
         Build the entire repository starting at the root resource.
         """
-        
         self.collection.build(self.path, "/")
         
         # Setup the principal-collection-set property if required
@@ -370,7 +366,6 @@
     """
     Parses a property from XML.
     """
-
     def __init__(self):
         self.prop = None
 
@@ -403,7 +398,6 @@
     """
     Parses a DAV:ACL from XML.
     """
-    
     def __init__(self):
         self.acl = None
 

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/resource.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/resource.py	2006-09-21 18:26:00 UTC (rev 168)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/resource.py	2006-09-21 18:26:08 UTC (rev 169)
@@ -395,7 +395,6 @@
         @return: the URI of the calendar outbox, or C{None} if no outbox for
             exists for the user.
         """
-        
         def _defer(principal):
             if principal:
                 return principal.scheduleOutboxURL()
@@ -416,7 +415,6 @@
         @return: the URI of the calendar inbox, or C{None} if no inbox exists
             for the user
         """
-        
         def _defer(principal):
             if principal:
                 return principal.scheduleInboxURL()
@@ -554,7 +552,6 @@
         @param address: the calendar user address to match.
         @return: C{True} if the principal matches, C{False} otherwise.
         """
-
         # By default we will always allow either a relative or absolute URI to the principal to
         # be supplied as a valid calendar user address.
 
@@ -579,7 +576,6 @@
         @return: L{Deferred} whose result is a list of calendars that contribute to free-busy for this
             principal's calendar user.
         """
-        
         def _defer(inbox):
             if inbox and inbox.hasDeadProperty((caldav_namespace, "calendar-free-busy-set")):
                 return inbox.readDeadProperty((caldav_namespace, "calendar-free-busy-set"))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20060921/df0b604b/attachment.html


More information about the calendarserver-changes mailing list