From 4699103b24c96583906274ba0f7acb7991b1b809 Mon Sep 17 00:00:00 2001 From: Bystroushaak Date: Tue, 8 Dec 2015 15:06:26 +0100 Subject: [PATCH] #7: Added docstrings for structures/incomming.py. --- .../amqp/rest/structures/incomming.py | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/edeposit/amqp/rest/structures/incomming.py b/src/edeposit/amqp/rest/structures/incomming.py index 9140222..5c220e6 100755 --- a/src/edeposit/amqp/rest/structures/incomming.py +++ b/src/edeposit/amqp/rest/structures/incomming.py @@ -3,19 +3,30 @@ # # Interpreter version: python 2.7 # +""" +Structures which may be used to store data in the REST subsystem. +""" # Imports ===================================================================== from collections import namedtuple -# Variables =================================================================== # Functions & classes ========================================================= class SaveLogin(namedtuple("SaveLogin", ["username", "password_hash"])): """ + Store new login to the user database. + + Attributes: + username (str): Name of the user. + password_hash (str): Bcrypt password hash. """ class RemoveLogin(namedtuple("RemoveLogin", ["username"])): """ + Remove user from the database. + + Attributes: + username (str): Name of the user. """ @@ -25,6 +36,15 @@ class StatusUpdate(namedtuple("StatusUpdate", ["rest_id", "pub_url", "book_name"])): """ + Save new status for the ebook. + + Attributes: + rest_id (str): String identifying the user's request. + timestamp (float): Timestamp output from ``time.time()`` + message (str): Content of the message. + pub_url (str): URL of the book in edeposit. + book_name (str): Name of the book. If not set (=None), it is used from + user's metadata. """ @@ -32,4 +52,6 @@ class CacheTick(namedtuple("CacheTick", [])): """ Tick for the cached uploader, telling it that it is OK to upload one more request, if present. + + This structure may also emit the :class:`.AfterDBCleanupRequest`. """