From 91225d6ff5bc70cd76d0cf54f35a1cf6186b538b Mon Sep 17 00:00:00 2001 From: necoro <> Date: Sat, 7 Jul 2007 02:27:31 +0000 Subject: Some documentation work --- portato/helper.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'portato/helper.py') diff --git a/portato/helper.py b/portato/helper.py index f327f75..9328223 100644 --- a/portato/helper.py +++ b/portato/helper.py @@ -10,6 +10,13 @@ # # Written by René 'Necoro' Neumann et.al. +""" +Some nice functions used in the program. + +@var DEBUG: Boolean controlling whether to printout debug messages. +@type DEBUG: boolean +""" + import traceback, os.path, sys, types DEBUG = True @@ -30,15 +37,13 @@ def debug(*args, **kwargs): If debug(obj0, obj1, obj2) is called, the text part of the output looks like the output from print obj0, obj1, obj2. - Keywords which can be used: - - name: Use the given name instead the correct function name. - - file: output file to use - - minus: The value given is the amount of frames to ignore in the stack to return the correct function call. - This should be used if you are wrapping the debug call. - - warn: Prints the message as a warning. Value of DEBUG is ignored. - - error: Prints the message as an error. Value of DEBUG is ignored.""" + @keyword name: Use the given name instead the correct function name. + @keyword file: Output file to use. + @keyword minus: The value given is the amount of frames to ignore in the stack to return the correct function call. + This should be used if you are wrapping the debug call. + @keyword warn: Prints the message as a warning. Value of DEBUG is ignored. + @keyword error: Prints the message as an error. Value of DEBUG is ignored.""" - if not DEBUG and not ("warn" in kwargs or "error" in kwargs): return stack = traceback.extract_stack() -- cgit v1.2.3