[CalendarServer-changes] [5176] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Sun Feb 21 19:32:56 PST 2010


Revision: 5176
          http://trac.macosforge.org/projects/calendarserver/changeset/5176
Author:   wsanchez at apple.com
Date:     2010-02-21 19:32:54 -0800 (Sun, 21 Feb 2010)
Log Message:
-----------
twext.python.icalendar -> twext.python.vcomponent (since it's used for both iCalendar and vCard)

Modified Paths:
--------------
    CalendarServer/trunk/txcaldav/calendarstore/file.py
    CalendarServer/trunk/txcaldav/calendarstore/test/test_file.py
    CalendarServer/trunk/txcaldav/icalendarstore.py

Added Paths:
-----------
    CalendarServer/trunk/twext/python/vcomponent.py

Removed Paths:
-------------
    CalendarServer/trunk/twext/python/icalendar.py

Deleted: CalendarServer/trunk/twext/python/icalendar.py
===================================================================
--- CalendarServer/trunk/twext/python/icalendar.py	2010-02-22 03:04:50 UTC (rev 5175)
+++ CalendarServer/trunk/twext/python/icalendar.py	2010-02-22 03:32:54 UTC (rev 5176)
@@ -1,24 +0,0 @@
-##
-# Copyright (c) 2010 Apple 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.
-##
-
-"""
-iCalendar utilities
-"""
-
-# FIXME: Move twistedcaldav.ical here, but that module needs some
-# cleanup first.  Perhaps after porting to libical?
-
-from twistedcaldav.ical import *

Copied: CalendarServer/trunk/twext/python/vcomponent.py (from rev 5173, CalendarServer/trunk/twext/python/vcomponent.py)
===================================================================
--- CalendarServer/trunk/twext/python/vcomponent.py	                        (rev 0)
+++ CalendarServer/trunk/twext/python/vcomponent.py	2010-02-22 03:32:54 UTC (rev 5176)
@@ -0,0 +1,26 @@
+##
+# Copyright (c) 2010 Apple 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.
+##
+
+"""
+iCalendar utilities
+"""
+
+# FIXME: Move twistedcaldav.ical here, but that module needs some
+# cleanup first.  Perhaps after porting to libical?
+
+from twistedcaldav.ical import InvalidICalendarDataError
+from twistedcaldav.ical import Component as VComponent
+from twistedcaldav.ical import Property as VProperty

Modified: CalendarServer/trunk/txcaldav/calendarstore/file.py
===================================================================
--- CalendarServer/trunk/txcaldav/calendarstore/file.py	2010-02-22 03:04:50 UTC (rev 5175)
+++ CalendarServer/trunk/txcaldav/calendarstore/file.py	2010-02-22 03:32:54 UTC (rev 5176)
@@ -33,8 +33,8 @@
 from twisted.internet.defer import inlineCallbacks
 
 from twext.python.log import LoggingMixIn
-from twext.python.icalendar import Component as iComponent
-from twext.python.icalendar import InvalidICalendarDataError
+from twext.python.vcomponent import VComponent
+from twext.python.vcomponent import InvalidICalendarDataError
 
 from txdav.propertystore.xattr import PropertyStore
 
@@ -272,8 +272,8 @@
         return self.path.basename()
 
     def setComponent(self, component):
-        if not isinstance(component, iComponent):
-            raise TypeError(iComponent)
+        if not isinstance(component, VComponent):
+            raise TypeError(VComponent)
 
         try:
             if component.resourceUID() != self.uid():
@@ -305,7 +305,7 @@
             text = self.iCalendarText()
 
             try:
-                component = iComponent.fromString(text)
+                component = VComponent.fromString(text)
             except InvalidICalendarDataError, e:
                 raise InternalDataStoreError(
                     "File corruption detected (%s) in file: %s"

Modified: CalendarServer/trunk/txcaldav/calendarstore/test/test_file.py
===================================================================
--- CalendarServer/trunk/txcaldav/calendarstore/test/test_file.py	2010-02-22 03:04:50 UTC (rev 5175)
+++ CalendarServer/trunk/txcaldav/calendarstore/test/test_file.py	2010-02-22 03:32:54 UTC (rev 5176)
@@ -23,7 +23,7 @@
 from twext.python.filepath import CachingFilePath as FilePath
 from twisted.trial import unittest
 
-from twext.python.icalendar import Component as iComponent
+from twext.python.vcomponent import VComponent
 
 from txdav.idav import IPropertyStore
 
@@ -477,7 +477,7 @@
         """
         name = "4.ics"
         assert self.calendar1.calendarObjectWithName(name) is None
-        component = iComponent.fromString(event4_text)
+        component = VComponent.fromString(event4_text)
         self.calendar1.createCalendarObjectWithName(name, component)
 
         calendarObject = self.calendar1.calendarObjectWithName(name)
@@ -490,7 +490,7 @@
         self.assertRaises(
             CalendarObjectNameAlreadyExistsError,
             self.calendar1.createCalendarObjectWithName,
-            "1.ics", iComponent.fromString(event4_text)
+            "1.ics", VComponent.fromString(event4_text)
         )
 
     def test_createCalendarObjectWithName_dot(self):
@@ -502,7 +502,7 @@
         self.assertRaises(
             CalendarObjectNameNotAllowedError,
             self.calendar1.createCalendarObjectWithName,
-            ".foo", iComponent.fromString(event4_text)
+            ".foo", VComponent.fromString(event4_text)
         )
 
     @featureUnimplemented
@@ -513,7 +513,7 @@
         """
         name = "foo.ics"
         assert self.calendar1.calendarObjectWithName(name) is None
-        component = iComponent.fromString(event1modified_text)
+        component = VComponent.fromString(event1modified_text)
         self.assertRaises(
             CalendarObjectUIDAlreadyExistsError,
             self.calendar1.createCalendarObjectWithName,
@@ -528,7 +528,7 @@
         self.assertRaises(
             InvalidCalendarComponentError,
             self.calendar1.createCalendarObjectWithName,
-            "new", iComponent.fromString(event4notCalDAV_text)
+            "new", VComponent.fromString(event4notCalDAV_text)
         )
 
     def test_removeCalendarObjectWithName_exists(self):
@@ -653,7 +653,7 @@
         """
         Rewrite component.
         """
-        component = iComponent.fromString(event1modified_text)
+        component = VComponent.fromString(event1modified_text)
 
         calendarObject = self.calendar1.calendarObjectWithName("1.ics")
         oldComponent = calendarObject.component() # Trigger caching
@@ -666,7 +666,7 @@
         self.assertEquals(calendarObject.component(), component)
 
     def test_setComponent_uidchanged(self):
-        component = iComponent.fromString(event4_text)
+        component = VComponent.fromString(event4_text)
 
         calendarObject = self.calendar1.calendarObjectWithName("1.ics")
         self.assertRaises(
@@ -679,7 +679,7 @@
         self.assertRaises(
             InvalidCalendarComponentError,
             calendarObject.setComponent,
-            iComponent.fromString(event4notCalDAV_text)
+            VComponent.fromString(event4notCalDAV_text)
         )
 
     def test_component(self):
@@ -689,7 +689,7 @@
         component = self.object1.component()
 
         self.failUnless(
-            isinstance(component, iComponent),
+            isinstance(component, VComponent),
             component
         )
 

Modified: CalendarServer/trunk/txcaldav/icalendarstore.py
===================================================================
--- CalendarServer/trunk/txcaldav/icalendarstore.py	2010-02-22 03:04:50 UTC (rev 5175)
+++ CalendarServer/trunk/txcaldav/icalendarstore.py	2010-02-22 03:32:54 UTC (rev 5176)
@@ -47,7 +47,7 @@
 from zope.interface import Interface #, Attribute
 
 from datetime import datetime, date, tzinfo
-from twext.python.icalendar import Component
+from twext.python.vcomponent import VComponent
 from txdav.idav import IPropertyStore
 
 #
@@ -231,7 +231,7 @@
             object with the same UID as the given C{component} already
             exists.
         @raise InvalidCalendarComponentError: if the given
-            C{component} is not a valid C{VCALENDAR} L{Component} for
+            C{component} is not a valid C{VCALENDAR} L{VComponent} for
             a calendar object.
         """
 
@@ -302,9 +302,9 @@
         C{component} must have the same UID and be of the same
         component type as this calendar object.
 
-        @param component: a C{VCALENDAR} L{Component}.
+        @param component: a C{VCALENDAR} L{VComponent}.
         @raise InvalidCalendarComponentError: if the given
-            C{component} is not a valid C{VCALENDAR} L{Component} for
+            C{component} is not a valid C{VCALENDAR} L{VComponent} for
             a calendar object.
         """
 
@@ -312,7 +312,7 @@
         """
         Retrieve the calendar component for this calendar object.
 
-        @return: a C{VCALENDAR} L{Component}.
+        @return: a C{VCALENDAR} L{VComponent}.
         """
 
     def iCalendarText():
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100221/fdc01e4a/attachment-0001.html>


More information about the calendarserver-changes mailing list