Exemple #1
0
def snapshot(ctx, board, cycle_time, done):
    ctx.obj['board_id'] = board
    ts = TrelloStats(ctx.obj)
    Snapshot.create_table(fail_silently=True)
    """
        Recording mode - Daily snapshots of a board for ongoing reporting:
         -> trellis report --board=87hiudhw
                          --cycle-time
                          --spend
                          --revenue
                          --done=Done

    """
    if cycle_time:
        done_id = ts.get_list_id_from_name(done)
        cards = ts.get_list_data(done_id)
        ct = ts.cycle_time(cards)
        print ct

        # Create snapshot
        Snapshot.create(board_id=board, done_id=done_id, cycle_time=ct)
Exemple #2
0
def resetdb(ctx):
    Snapshot.drop_table()
    Snapshot.create_table()
    click.echo('Snapshots table dropped.')