Exemplo n.º 1
0
def do_marker(budget, unmarked=False, raw=False):
    parser = Parser(budget)
    parser.go()

    marker = RawMarker() if raw else Marker()

    for row, typ in parser:
        marker(row, typ)

    for title in marker.tagger.codes_titles:
        val = marker.sum_out.get(title)
        if not val:
            continue

        print 'marked', human_money(val), val, title.strip()

    if unmarked or raw:
        print_unmarked(marker.names, marker.sum_unmarked)
    else:
        print_unmarked_sum(marker.all_sum, marker.marked)
Exemplo n.º 2
0
def print_unmarked(names, sum_unmarked):
    for idx, val in sum_unmarked.items():
        if not val:
            continue

        print 'unmarked', human_money(val), val, names[idx].strip().encode('utf8')
Exemplo n.º 3
0
def print_unmarked_sum(all_sum, marked):
    print 'unmarked', human_money(all_sum - marked), '%4.2f' %(all_sum - marked), 'Untagged'