()
Format and print the currently running modules.
Format and print the currently running modules.
Format and print the currently running modules .
def dump_sessions():
    """Format and print the currently running modules.
    """
    global HOUSE

    print color.B_GREEN + '\n\t[' + color.B_YELLOW + 'Running sessions' + \
          color.B_GREEN + ']' + color.END
    if 'service' in HOUSE:
        # services first
        tmp = HOUSE['service']
        if len(tmp) > 0:
            print color.B_GREEN + '\t[' + color.B_YELLOW + '0' + color.B_GREEN + \
                    '] ' + color.B_WHITE + 'Services' + color.END
        for (cnt, service) in enumerate(tmp):
            print color.B_GREEN + '\t\t[' + color.B_YELLOW + str(cnt) + color.B_GREEN + \
                  '] ' + color.B_WHITE + tmp[service].session_view() + color.END
            if tmp[service].log_data:
                print color.B_YELLOW + '\t\t\t--> ' + color.B_WHITE + 'Logging to ' + \
                      tmp[service].log_file.name + color.END

    for (cnt, key) in enumerate(HOUSE.keys()):
        if key is 'service':
            continue
        if len(HOUSE[key]) > 0:
            print color.B_GREEN + '\t[' + color.B_YELLOW + str(cnt) + color.B_GREEN + \
                  ']' + color.B_WHITE  + ' ' + key + color.END
        for (cnt, obj) in enumerate(HOUSE[key]):
            print color.B_GREEN + '\t\t[' + color.B_YELLOW + str(cnt) + color.B_GREEN + \
                  '] ' + color.B_WHITE + HOUSE[key][obj].session_view() + color.END
            if hasattr(HOUSE[key][obj], 'log_data'):
                if HOUSE[key][obj].log_data:
                    print color.B_YELLOW + '\t\t\t--> ' + color.B_WHITE + 'Logging to ' + \
                          HOUSE[key][obj].log_file.name + color.END
    print '\n'
def dump_sessions ( ) : global HOUSE print color . B_GREEN + '\n\t[' + color . B_YELLOW + 'Running sessions' + color . B_GREEN + ']' + color . END if 'service' in HOUSE : # services first tmp = HOUSE [ 'service' ] if len ( tmp ) > 0 : print color . B_GREEN + '\t[' + color . B_YELLOW + '0' + color . B_GREEN + '] ' + color . B_WHITE + 'Services' + color . END for ( cnt , service ) in enumerate ( tmp ) : print color . B_GREEN + '\t\t[' + color . B_YELLOW + str ( cnt ) + color . B_GREEN + '] ' + color . B_WHITE + tmp [ service ] . session_view ( ) + color . END if tmp [ service ] . log_data : print color . B_YELLOW + '\t\t\t--> ' + color . B_WHITE + 'Logging to ' + tmp [ service ] . log_file . name + color . END for ( cnt , key ) in enumerate ( HOUSE . keys ( ) ) : if key is 'service' : continue if len ( HOUSE [ key ] ) > 0 : print color . B_GREEN + '\t[' + color . B_YELLOW + str ( cnt ) + color . B_GREEN + ']' + color . B_WHITE + ' ' + key + color . END for ( cnt , obj ) in enumerate ( HOUSE [ key ] ) : print color . B_GREEN + '\t\t[' + color . B_YELLOW + str ( cnt ) + color . B_GREEN + '] ' + color . B_WHITE + HOUSE [ key ] [ obj ] . session_view ( ) + color . END if hasattr ( HOUSE [ key ] [ obj ] , 'log_data' ) : if HOUSE [ key ] [ obj ] . log_data : print color . B_YELLOW + '\t\t\t--> ' + color . B_WHITE + 'Logging to ' + HOUSE [ key ] [ obj ] . log_file . name + color . END print '\n'