[CalendarServer-changes] [5041] CalendarServer/trunk/txcaldav/calendarstore
source_changes at macosforge.org
source_changes at macosforge.org
Wed Feb 3 15:31:23 PST 2010
Revision: 5041
http://trac.macosforge.org/projects/calendarserver/changeset/5041
Author: wsanchez at apple.com
Date: 2010-02-03 15:31:23 -0800 (Wed, 03 Feb 2010)
Log Message:
-----------
Whoops, undo 5040
Modified Paths:
--------------
CalendarServer/trunk/txcaldav/calendarstore/file.py
CalendarServer/trunk/txcaldav/calendarstore/test/test_file.py
Modified: CalendarServer/trunk/txcaldav/calendarstore/file.py
===================================================================
--- CalendarServer/trunk/txcaldav/calendarstore/file.py 2010-02-03 23:30:35 UTC (rev 5040)
+++ CalendarServer/trunk/txcaldav/calendarstore/file.py 2010-02-03 23:31:23 UTC (rev 5041)
@@ -159,52 +159,19 @@
def __repr__(self):
return "<%s: %s>" % (self.__class__.__name__, self.path.path)
- def index(self):
- #
- # OK, here's where we get ugly.
- # The index code needs to be rewritten also, but in the meantime...
- #
- class StubResource(object):
- """
- Just enough resource to keep the Index class going.
- """
- def __init__(self, calendar):
- self.calendar = calendar
- self.fp = self.calendar.path
-
- def getChild(self, name):
- # None if no child... else child needs to support .iCalendar()
- raise NotImplementedError()
-
- def bumpSyncToken(self, xxx):
- raise NotImplementedError()
-
- if not hasattr(self, "_index"):
- self._index = Index(StubResource(self))
- return self._index
-
def name(self):
return self.path.basename()
def ownerCalendarHome(self):
return self.calendarHome
- def _calendarObjects_index(self):
- for name, uid, componentType in self.index().bruteForceSearch():
- calendarObject = self.calendarObjectWithName(name)
- calendarObject._uid = uid
- calendarObject._componentType = componentType
-
-
- def _calendarObjects_listdir(self):
+ def calendarObjects(self):
return (
self.calendarObjectWithName(name)
for name in self.path.listdir()
if not name.startswith(".")
)
- calendarObjects = _calendarObjects_index
-
def calendarObjectWithName(self, name):
childPath = self.path.child(name)
if childPath.isfile():
@@ -271,13 +238,6 @@
if not isinstance(component, iComponent):
raise TypeError(iComponent)
- if component.resourceUID() != self.uid():
- raise InvalidCalendarComponentError(
- "UID may not change (%s != %s)" % (
- component.resourceUID(), self.uid()
- )
- )
-
try:
component.validateForCalDAV()
except InvalidICalendarDataError, e:
Modified: CalendarServer/trunk/txcaldav/calendarstore/test/test_file.py
===================================================================
--- CalendarServer/trunk/txcaldav/calendarstore/test/test_file.py 2010-02-03 23:30:35 UTC (rev 5040)
+++ CalendarServer/trunk/txcaldav/calendarstore/test/test_file.py 2010-02-03 23:31:23 UTC (rev 5041)
@@ -647,12 +647,13 @@
calendarObject = self.calendar1.calendarObjectWithName("1.ics")
self.assertEquals(calendarObject.component(), component)
+ @featureUnimplemented
def test_setComponent_uidchanged(self):
component = iComponent.fromString(event4_text)
calendarObject = self.calendar1.calendarObjectWithName("1.ics")
self.assertRaises(
- InvalidCalendarComponentError,
+ CalendarObjectUIDAlreadyExistsError,
calendarObject.setComponent, component
)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100203/b852ce4b/attachment-0001.html>
More information about the calendarserver-changes
mailing list