[CalendarServer-changes] [6333] CalendarServer/branches/users/glyph/more-deferreds-6
source_changes at macosforge.org
source_changes at macosforge.org
Tue Sep 21 17:00:36 PDT 2010
Revision: 6333
http://trac.macosforge.org/projects/calendarserver/changeset/6333
Author: glyph at apple.com
Date: 2010-09-21 17:00:35 -0700 (Tue, 21 Sep 2010)
Log Message:
-----------
a little more asyncification
Modified Paths:
--------------
CalendarServer/branches/users/glyph/more-deferreds-6/twistedcaldav/storebridge.py
CalendarServer/branches/users/glyph/more-deferreds-6/txdav/common/datastore/test/test_util.py
Modified: CalendarServer/branches/users/glyph/more-deferreds-6/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/branches/users/glyph/more-deferreds-6/twistedcaldav/storebridge.py 2010-09-21 23:38:39 UTC (rev 6332)
+++ CalendarServer/branches/users/glyph/more-deferreds-6/twistedcaldav/storebridge.py 2010-09-22 00:00:35 UTC (rev 6333)
@@ -1187,7 +1187,12 @@
self._newStoreParentCalendar.createCalendarObjectWithName(
self.name(), component
)
- CalendarObjectResource.transform(self, self._newStoreParentCalendar.calendarObjectWithName(self.name()))
+ CalendarObjectResource.transform(
+ self,
+ (yield self._newStoreParentCalendar.calendarObjectWithName(
+ self.name()
+ ))
+ )
returnValue(CREATED)
Modified: CalendarServer/branches/users/glyph/more-deferreds-6/txdav/common/datastore/test/test_util.py
===================================================================
--- CalendarServer/branches/users/glyph/more-deferreds-6/txdav/common/datastore/test/test_util.py 2010-09-21 23:38:39 UTC (rev 6332)
+++ CalendarServer/branches/users/glyph/more-deferreds-6/txdav/common/datastore/test/test_util.py 2010-09-22 00:00:35 UTC (rev 6333)
@@ -29,7 +29,7 @@
from txdav.common.datastore.test.util import theStoreBuilder, \
populateCalendarsFrom
from txdav.caldav.datastore.test.common import StubNotifierFactory, CommonTests
-from twisted.internet.defer import inlineCallbacks, Deferred
+from twisted.internet.defer import inlineCallbacks, Deferred, returnValue
class HomeMigrationTests(TestCase):
@@ -124,10 +124,13 @@
committed.append(True)
txn.commit()
self.addCleanup(maybeCommit)
+ @inlineCallbacks
def getSampleObj():
- return txn.calendarHomeWithUID("home1").calendarWithName(
- "calendar_1").calendarObjectWithName("1.ics")
- inObject = getSampleObj()
+ home = (yield txn.calendarHomeWithUID("home1"))
+ calendar = (yield home.calendarWithName("calendar_1"))
+ object = (yield calendar.calendarObjectWithName("1.ics"))
+ returnValue(object)
+ inObject = yield getSampleObj()
someAttachmentName = "some-attachment"
someAttachmentType = MimeType.fromString("application/x-custom-type")
transport = inObject.createAttachmentWithName(
@@ -141,7 +144,7 @@
yield self.subStarted
committed = []
txn = self.sqlStore.newTransaction()
- outObject = getSampleObj()
+ outObject = yield getSampleObj()
outAttachment = outObject.attachmentWithName(someAttachmentName)
allDone = Deferred()
class SimpleProto(Protocol):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100921/f5214b41/attachment-0001.html>
More information about the calendarserver-changes
mailing list