[CalendarServer-changes] [12577] CalendarServer/trunk/txdav/dps

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:18:54 PDT 2014


Revision: 12577
          http://trac.calendarserver.org//changeset/12577
Author:   sagen at apple.com
Date:     2014-02-05 14:20:51 -0800 (Wed, 05 Feb 2014)
Log Message:
-----------
Comments

Modified Paths:
--------------
    CalendarServer/trunk/txdav/dps/client.py
    CalendarServer/trunk/txdav/dps/test/test_client.py

Modified: CalendarServer/trunk/txdav/dps/client.py
===================================================================
--- CalendarServer/trunk/txdav/dps/client.py	2014-02-05 22:16:48 UTC (rev 12576)
+++ CalendarServer/trunk/txdav/dps/client.py	2014-02-05 22:20:51 UTC (rev 12577)
@@ -108,6 +108,19 @@
 
     @inlineCallbacks
     def _call(self, command, postProcess, **kwds):
+        """
+        Execute a remote AMP command, first making the connection to the peer,
+        then making the call, then running the results through the postProcess
+        callback.  Any kwds are passed on to the AMP command.
+
+        @param command: the AMP command to call
+        @type command: L{twisted.protocols.amp.Command}
+
+        @param postProcess: a callable which takes the AMP response dictionary
+            and peforms any required massaging of the results, returning a
+            L{Deferred} which fires with the post-processed results
+        @type postProcess: callable
+        """
         ampProto = (yield self._getConnection())
         results = (yield ampProto.callRemote(command, **kwds))
         returnValue(postProcess(results))

Modified: CalendarServer/trunk/txdav/dps/test/test_client.py
===================================================================
--- CalendarServer/trunk/txdav/dps/test/test_client.py	2014-02-05 22:16:48 UTC (rev 12576)
+++ CalendarServer/trunk/txdav/dps/test/test_client.py	2014-02-05 22:20:51 UTC (rev 12577)
@@ -39,8 +39,12 @@
         pump = returnConnected(server, client)
         self.directory = DirectoryService(None)
 
+        # Replace the normal _getConnection method with one that bypasses any
+        # actual networking
         self.patch(self.directory, "_getConnection", lambda: succeed(client))
 
+        # Wrap the normal _call method with one that flushes the IOPump
+        # afterwards
         origCall = self.directory._call
 
         def newCall(*args, **kwds):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/2f933d1c/attachment.html>


More information about the calendarserver-changes mailing list