]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Add magic-folder download callback
authorDavid Stainton <dstainton415@gmail.com>
Wed, 1 Jul 2015 00:33:37 +0000 (17:33 -0700)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 20 Jul 2015 23:42:35 +0000 (00:42 +0100)
src/allmydata/frontends/magic_folder.py

index 8131cad7d9588f0e34d174ffd045b071e1c4acb0..9ad4f44a066fa8d832f3dfbf5493f6610c102cc5 100644 (file)
@@ -85,7 +85,9 @@ class MagicFolder(service.MultiService):
             raise AssertionError("The URI in 'private/magic_folder_dircap' is not a writecap to a directory.")
 
         self._processed_callback = lambda ign: None
+        self._download_callback = lambda ign: None
         self._ignore_count = 0
+        self._download_ignore_count = 0
 
         self._notifier = inotify.INotify()
         if hasattr(self._notifier, 'set_pending_delay'):
@@ -283,10 +285,19 @@ class MagicFolder(service.MultiService):
             self._ignore_count -= 1
         return None  # intentionally suppress failures, which have already been logged
 
+    def set_download_callback(self, callback, ignore_count=0):
+        """
+        set_download_callback sets a function that will be called after a
+        remote filesystem notification has been processed (successfully or unsuccessfully).
+        """
+        self._download_callback = callback
+        self._download_ignore_count = ignore_count
+
+
     def set_processed_callback(self, callback, ignore_count=0):
         """
-        This sets a function that will be called after a notification has been processed
-        (successfully or unsuccessfully).
+        set_processed_callback sets a function that will be called after a
+        local filesystem notification has been processed (successfully or unsuccessfully).
         """
         self._processed_callback = callback
         self._ignore_count = ignore_count