From 05eab3ce19d5cc1eaa9b5c79a0f31790c957bf40 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 11 Mar 2019 12:26:42 -0400 Subject: [PATCH] document these things since I had to figure them out --- src/allmydata/frontends/magic_folder.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index f7ce5f1a4..db0ed3961 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -1827,6 +1827,25 @@ class Downloader(QueueMixin, WriteFileMixin): return collective_dirmap_d.addActionFinish() def _scan_remote_dmd(self, nickname, dirnode, scan_batch): + """ + Read the contents of a single DMD into the given batch. + + :param unicode nickname: The nickname for the participant owning the + DMD to scan. + + :param IDirectoryNode dirnode: The node representing the chosen + participant's DMD. + + :param dict scan_batch: A dictionary into which to collect the results + of the scan. This is mutated to add the results in-place. Keys + are the unicode relative paths of contents of the DMD. Values are + a list of two-tuples. The first element of each two-tuple is the + ``IFilesystemNode`` for the content. The second element is a + ``dict`` of metadata. + + :return Deferred: A ``Deferred`` which fires when the scan is + complete. + """ with SCAN_REMOTE_DMD(nickname=nickname).context(): d = DeferredContext(dirnode.list()) def scan_listing(listing_map):