added constants to template
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 10 Sep 2015 15:52:11 +0000 (17:52 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Fri, 11 Sep 2015 07:16:23 +0000 (09:16 +0200)
template.py

index f61c870..1ad91c2 100644 (file)
@@ -34,6 +34,15 @@ in this docstring, but please keep it brief!
 .. codeauthor:: John Doe, john.doe@intra2net.com
 """
 
+THE_CONSTANT = None
+""" some constant with docstring *AFTER* the constant. Use this format! """
+
+
+ANOTHER_CONSTANT = 1     #: short docstring in same line -- note the #:
+
+#: constant with docstring in line above it -- note the #:
+THIRD_CONST = 3.333
+
 
 class TestClass:
     """
@@ -71,6 +80,11 @@ def send_message(sender, recipient, message_body, priority=1):
     Does not use :py:class:`TestClass` at all. Also has nothing to do with
     the python module :py:mod:`logging.handlers`
 
+    Note that it is completely irrelevant what :py:data:`THE_CONSTANT` or
+    :py:data:`ANOTHER_CONSTANT` or :py:data:`THIRD_CONSTANT` are set to. I just
+    wanted to insert a link to a constant somewhere and find out how to
+    document constants
+
     :param str sender: The person sending the message
     :param str recipient: The recipient of the message
     :param str message_body: The body of the message