aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/daide/tokens.py
diff options
context:
space:
mode:
authorPhilip Paquette <pcpaquette@gmail.com>2019-09-11 12:58:45 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-09-14 18:18:53 -0400
commitabb42dcd4886705d6ba8af27f68ef605218ac67c (patch)
tree9ae16f7a09fff539fa72e65198e284bca6ac3376 /diplomacy/daide/tokens.py
parenta954a00d263750c279dbb2c0a9ae85707022bcd7 (diff)
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 <pcpaquette@gmail.com> Co-authored-by: notoraptor <stevenbocco@gmail.com>
Diffstat (limited to 'diplomacy/daide/tokens.py')
-rw-r--r--diplomacy/daide/tokens.py4
1 files changed, 4 insertions, 0 deletions
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