示例#1
0
def main():
    ## Logfile
    log = Logfile(dailyLog, stepLog, date_regex)

    ## Search for dates and pedometer measurements and output to stepLog
    log.date_and_y('^#steps\s\d{0,}')
    step_cleanup(stepLog)
    ## Match date with corresponding steps or remove dates with no matches
    log.match_date_and_y(step_regex)
    ## Generate list of dates
    dates = log.str_to_float_list(log.gen_list(date_regex))
    logging.debug(dates)
    ## Generate list of steps
    steps = log.str_to_float_list(log.gen_list(step_regex))
    logging.debug(steps)
    logging.debug('Dates: ' + str(len(dates)))
    logging.debug('Steps: ' + str(len(steps)))

    ## GenerateGraph
    graph = GenerateGraph('Dates and Steps',    # Title
            dates, '2015-1-1',                  # x_axis
            steps, 'Steps')                     # y_axis

    if not args.nograph:
        graph.gen_date_y_graph('o') # 'o' y_marker