From abb42dcd4886705d6ba8af27f68ef605218ac67c Mon Sep 17 00:00:00 2001 From: Philip Paquette Date: Wed, 11 Sep 2019 12:58:45 -0400 Subject: Added ReadtheDocs documentation for the public API - Reformatted the docstring to be compatible - Added tests to make sure the documentation compiles properly - Added sphinx as a pip requirement Co-authored-by: Philip Paquette Co-authored-by: notoraptor --- diplomacy/daide/tokens.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'diplomacy/daide/tokens.py') diff --git a/diplomacy/daide/tokens.py b/diplomacy/daide/tokens.py index 5009170..93500b0 100644 --- a/diplomacy/daide/tokens.py +++ b/diplomacy/daide/tokens.py @@ -27,6 +27,7 @@ class Token: def __init__(self, from_str=None, from_int=None, from_bytes=None): """ Initialize a token from its string representation, or from its bytes representation + :param from_str: The string representation of the token :param from_int: The integer representation of the token :param from_bytes: The byte representation of the token @@ -139,6 +140,7 @@ class Token: def is_ascii_token(token): """ Check if the token is an ascii token + :param token: An instance of Token :return: True if `token` is an acsii token. False otherwise """ @@ -147,6 +149,7 @@ def is_ascii_token(token): def is_integer_token(token): """ Check if the token is an integer token + :param token: An instance of Token :return: True if `token` is an integer token. False otherwise """ @@ -155,6 +158,7 @@ def is_integer_token(token): def register_token(str_repr, bytes_repr): """ Registers a token in the registry + :param str_repr: The DAIDE string representation of the token (e.g. 'ECS') :param bytes_repr: The bytes representation of the token (i.e. bytes of length 2) :return: The token that has been registered -- cgit v1.2.3