[debug_channels/doc] add docstring to functions
authorLaurent Peuch <cortex@worlddomination.be>
Wed, 11 Dec 2019 00:01:38 +0100
changeset 12802 f6662c603730
parent 12801 1156108afab9
child 12803 bf940d5416e5
[debug_channels/doc] add docstring to functions
cubicweb/debug.py
--- a/cubicweb/debug.py	Tue Dec 10 23:34:46 2019 +0100
+++ b/cubicweb/debug.py	Wed Dec 11 00:01:38 2019 +0100
@@ -31,6 +31,15 @@
 
 
 def subscribe_to_debug_channel(channel, subscriber):
+    """
+    Allow to subscribe a callable to one of the debug channels.
+
+    The channel must be one of: %s
+
+    And the callable need to accept one argument.
+
+    It will raise Exception if the channel doesn't exist.
+    """ % SUBSCRIBERS.keys()
     if channel not in SUBSCRIBERS.keys():
         raise Exception("debug channel '%s' doesn't exist" % channel)
 
@@ -38,6 +47,10 @@
 
 
 def unsubscribe_to_debug_channel(channel, subscriber):
+    """
+    Unsubscribe a callable from a channel. It will raise Exception if the
+    channel doesn't exist nor
+    """
     if channel not in SUBSCRIBERS.keys():
         raise Exception("debug channel '%s' doesn't exist" % channel)
 
@@ -48,6 +61,12 @@
 
 
 def emit_to_debug_channel(channel, message):
+    """
+    Send a message to a specified debug channel that will call all its
+    subscribers.
+
+    It will raise Exception if the channel doesn't exist.
+    """
     if channel not in SUBSCRIBERS.keys():
         raise Exception("debug channel '%s' doesn't exist" % channel)