Esempio n. 1
0
def print_list( the_list, the_printing_depth = 0 ) :
    "Optional printing of debug messages"
    from options import is_debug

    if not is_debug() : 
        return

    for an_item in the_list :
        print_d( "%s\n" % ( an_item ), the_printing_depth ) 
        pass
    pass
Esempio n. 2
0
def print_d( the_message, the_printing_depth = 0 ) :
    "Optional printing of debug messages"
    PRINTING_LOCK.acquire()

    from options import is_debug
    if is_debug() : 
        sys.stderr.write( get_preffix( "    ", the_printing_depth ) + the_message )
    else:
        sys.stderr.write( '.' )
        pass

    PRINTING_LOCK.release()
    pass