01234567890123456789012345678901234567890123456789012345678901234567890123456789
8081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 | <----SKIPPED LINES----> (1, 'day_of_month'), (2, 'origin'), (3, 'destination'), (4, 'airline'), (5, 'aircraft'), (6, 'altitude'), (7, 'bearing'), (8, 'distance'), (9, 'day_of_week'), (10, 'all')) HISTOGRAM_HISTORY = ( (0, 'today'), (1, '24h'), (2, '7d'), (3, '30d')) def Log(message, ser=None, file=ARDUINO_LOG): """Logs with additional serial-connection details if provided""" if file is None: file = messageboard.LOGFILE if ser: additional_text = str(ser) else: additional_text = 'ARDUINO' if file == ARDUINO_LOG: rolling = ARDUINO_ROLLING_LOG else: rolling = None messageboard.Log('%s: %s' % (additional_text, message), file=file, rolling=rolling) class Serial(): """Serial object that allows for different connection types to be easily swapped. The Serial class allows for a persistent connection over one of several types of serial connections: USB, bluetooth, and simulation via text file. It fully encapsulates error management so that the details of reconnecting on errors are hidden, yet it does check for and recover from timeouts, dropped connections, etc. <----SKIPPED LINES----> |
01234567890123456789012345678901234567890123456789012345678901234567890123456789
8081828384858687888990919293949596979899 100101102103104105106107108109110111112113114115116117118119 | <----SKIPPED LINES----> (1, 'day_of_month'), (2, 'origin'), (3, 'destination'), (4, 'airline'), (5, 'aircraft'), (6, 'altitude'), (7, 'bearing'), (8, 'distance'), (9, 'day_of_week'), (10, 'all')) HISTOGRAM_HISTORY = ( (0, 'today'), (1, '24h'), (2, '7d'), (3, '30d')) def Log(message, ser=None, file=ARDUINO_LOG): """Logs with additional serial-connection details if provided""" if ser: additional_text = str(ser) else: additional_text = 'ARDUINO' if file == ARDUINO_LOG: rolling = ARDUINO_ROLLING_LOG else: rolling = None messageboard.Log('%s: %s' % (additional_text, message), file=file, rolling=rolling) class Serial(): """Serial object that allows for different connection types to be easily swapped. The Serial class allows for a persistent connection over one of several types of serial connections: USB, bluetooth, and simulation via text file. It fully encapsulates error management so that the details of reconnecting on errors are hidden, yet it does check for and recover from timeouts, dropped connections, etc. <----SKIPPED LINES----> |