Skip to content

Commit

Permalink
#7: Added docstrings for structures/incomming.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bystroushaak committed Dec 8, 2015
1 parent 583b472 commit 4699103
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/edeposit/amqp/rest/structures/incomming.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""


Expand All @@ -25,11 +36,22 @@ 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.
"""


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`.
"""

0 comments on commit 4699103

Please sign in to comment.