[CalendarServer-changes] [166] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Sep 21 10:39:16 PDT 2006


Revision: 166
          http://trac.macosforge.org/projects/collaboration/changeset/166
Author:   wsanchez at apple.com
Date:     2006-09-21 10:39:15 -0700 (Thu, 21 Sep 2006)

Log Message:
-----------
cosmetic

Modified Paths:
--------------
    CalendarServer/trunk/support/CalDAV.xcodeproj/project.pbxproj
    CalendarServer/trunk/twistedcaldav/directory.py
    CalendarServer/trunk/twistedcaldav/http.py
    CalendarServer/trunk/twistedcaldav/ical.py
    CalendarServer/trunk/twistedcaldav/itip.py
    CalendarServer/trunk/twistedcaldav/method/report_common.py
    CalendarServer/trunk/twistedcaldav/principalindex.py
    CalendarServer/trunk/twistedcaldav/repository.py
    CalendarServer/trunk/twistedcaldav/resource.py

Removed Paths:
-------------
    CalendarServer/trunk/twistedcaldav/constants.py

Modified: CalendarServer/trunk/support/CalDAV.xcodeproj/project.pbxproj
===================================================================
--- CalendarServer/trunk/support/CalDAV.xcodeproj/project.pbxproj	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/support/CalDAV.xcodeproj/project.pbxproj	2006-09-21 17:39:15 UTC (rev 166)
@@ -59,6 +59,14 @@
 		353696D1092BB6500075CE69 /* test_icalendar.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = test_icalendar.py; sourceTree = "<group>"; };
 		353A557C099153D900A08D28 /* setup.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = setup.py; path = ../setup.py; sourceTree = "<group>"; };
 		353A63BF0994448C00A08D28 /* caldavd */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = caldavd; sourceTree = "<group>"; };
+		356E29FC0AC301C900F46D07 /* authkerb.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = authkerb.py; sourceTree = "<group>"; };
+		356E29FE0AC301C900F46D07 /* customxml.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = customxml.py; sourceTree = "<group>"; };
+		356E29FF0AC301C900F46D07 /* db.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = db.py; sourceTree = "<group>"; };
+		356E2A000AC301C900F46D07 /* directory.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = directory.py; sourceTree = "<group>"; };
+		356E2A010AC301C900F46D07 /* itip.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = itip.py; sourceTree = "<group>"; };
+		356E2A020AC301C900F46D07 /* principalindex.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = principalindex.py; sourceTree = "<group>"; };
+		356E2A440AC3057F00F46D07 /* post.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = post.py; sourceTree = "<group>"; };
+		356E2A450AC3057F00F46D07 /* schedule_common.py */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.python; path = schedule_common.py; sourceTree = "<group>"; };
 		359CD65C0946136A002E3A15 /* test_xml.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = test_xml.py; sourceTree = "<group>"; };
 		35A15ED40985C14800D404FF /* run */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; name = run; path = ../run; sourceTree = "<group>"; };
 		35A15ED60985C14800D404FF /* test */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; name = test; path = ../test; sourceTree = "<group>"; };
@@ -106,13 +114,19 @@
 				35F36C0E09B4FA6A00A3D736 /* icaldav.py */,
 				35F36BAF09B3E8AD00A3D736 /* resource.py */,
 				35069C2A0922B96300389D48 /* static.py */,
+				35B8AA660A0BFE60005547E5 /* http.py */,
+				35069C190922B96300389D48 /* caldavxml.py */,
+				356E29FE0AC301C900F46D07 /* customxml.py */,
+				356E29FC0AC301C900F46D07 /* authkerb.py */,
 				35069C840922B96300389D48 /* ical.py */,
+				356E2A010AC301C900F46D07 /* itip.py */,
+				35B71A24097C3A3000E65B22 /* instance.py */,
 				350781A2096DF5A4004A4366 /* dateops.py */,
-				35B71A24097C3A3000E65B22 /* instance.py */,
 				35069C1B0922B96300389D48 /* index.py */,
-				35069C190922B96300389D48 /* caldavxml.py */,
+				356E2A020AC301C900F46D07 /* principalindex.py */,
+				356E29FF0AC301C900F46D07 /* db.py */,
 				35B8AA670A0BFE60005547E5 /* repository.py */,
-				35B8AA660A0BFE60005547E5 /* http.py */,
+				356E2A000AC301C900F46D07 /* directory.py */,
 				35E2ACFF09BF6D3400BC8CB9 /* logging.py */,
 				35069C170922B96300389D48 /* __init__.py */,
 				35069C1D0922B96300389D48 /* method */,
@@ -124,10 +138,12 @@
 		35069C1D0922B96300389D48 /* method */ = {
 			isa = PBXGroup;
 			children = (
+				356E2A450AC3057F00F46D07 /* schedule_common.py */,
 				35B71A25097C3B2C00E65B22 /* copymove.py */,
 				35B71A26097C3B2C00E65B22 /* delete.py */,
 				35069C200922B96300389D48 /* mkcalendar.py */,
 				35069C220922B96300389D48 /* mkcol.py */,
+				356E2A440AC3057F00F46D07 /* post.py */,
 				35069C240922B96300389D48 /* put.py */,
 				35E2AF1409C2491600BC8CB9 /* put_common.py */,
 				35069C260922B96300389D48 /* report_calquery.py */,

Deleted: CalendarServer/trunk/twistedcaldav/constants.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/constants.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/constants.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -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/trunk/twistedcaldav/directory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/directory.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -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/trunk/twistedcaldav/http.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/http.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/http.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -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/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/ical.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -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/trunk/twistedcaldav/itip.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/itip.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/itip.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -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/trunk/twistedcaldav/method/report_common.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/report_common.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/method/report_common.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -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/trunk/twistedcaldav/principalindex.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/principalindex.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/principalindex.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -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/trunk/twistedcaldav/repository.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/repository.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/repository.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -145,7 +145,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 )
@@ -177,8 +176,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.
@@ -207,7 +204,6 @@
         """
         Build the entire repository starting at the root resource.
         """
-        
         self.collection.build(self.path, "/")
         
         # Setup the principal-collection-set property if required
@@ -353,7 +349,6 @@
     """
     Parses a property from XML.
     """
-
     def __init__(self):
         self.prop = None
 
@@ -386,7 +381,6 @@
     """
     Parses a DAV:ACL from XML.
     """
-    
     def __init__(self):
         self.acl = None
 

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2006-09-20 23:57:18 UTC (rev 165)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2006-09-21 17:39:15 UTC (rev 166)
@@ -386,7 +386,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()
@@ -407,7 +406,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()
@@ -545,7 +543,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.
 
@@ -570,7 +567,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/5aa84b36/attachment.html


More information about the calendarserver-changes mailing list