From 8dff8818ca7ad262d6713c176e7189cb87467d1f Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Wed, 16 Oct 2019 09:17:46 -0400 Subject: [PATCH] docstrings --- src/_zkapauthorizer/_storage_server.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/_zkapauthorizer/_storage_server.py b/src/_zkapauthorizer/_storage_server.py index 8de998e..2455cc6 100644 --- a/src/_zkapauthorizer/_storage_server.py +++ b/src/_zkapauthorizer/_storage_server.py @@ -480,6 +480,13 @@ def get_share_sizes(storage_server, storage_index_or_slot, sharenums): def get_storage_index_share_size(sharepath): + """ + Get the size of a share belonging to a storage index (an immutable share). + + :param bytes sharepath: The path to the share file. + + :return int: The data size of the share in bytes. + """ with open(sharepath) as share_file: share_data_length_bytes = share_file.read(8)[4:] (share_data_length,) = unpack('>L', share_data_length_bytes) @@ -487,6 +494,13 @@ def get_storage_index_share_size(sharepath): def get_slot_share_size(sharepath): + """ + Get the size of a share belonging to a slot (a mutable share). + + :param bytes sharepath: The path to the share file. + + :return int: The data size of the share in bytes. + """ with open(sharepath) as share_file: share_data_length_bytes = share_file.read(92)[-8:] (share_data_length,) = unpack('>Q', share_data_length_bytes) -- GitLab