(sources)
Print statistics to the terminal
Print statistics to the terminal
Print statistics to the terminal
def output_to_terminal(sources):
    """Print statistics to the terminal"""
    results = OrderedDict()
    for source in sources:
        if source.get_is_available():
            source.update()
            source_name = source.get_source_name()
            results[source_name] = source.get_sensors_summary()
    for key, value in results.items():
        sys.stdout.write(str(key) + ": ")
        for skey, svalue in value.items():
            sys.stdout.write(str(skey) + ": " + str(svalue) + ", ")
    sys.stdout.write("\n")
    sys.exit()
def output_to_terminal ( sources ) : results = OrderedDict ( ) for source in sources : if source . get_is_available ( ) : source . update ( ) source_name = source . get_source_name ( ) results [ source_name ] = source . get_sensors_summary ( ) for key , value in results . items ( ) : sys . stdout . write ( str ( key ) + ": " ) for skey , svalue in value . items ( ) : sys . stdout . write ( str ( skey ) + ": " + str ( svalue ) + ", " ) sys . stdout . write ( "\n" ) sys . exit ( )