'return a png with percentage'

def handle_counter(abe, page):

    (address, donations, target, secret) = abe.get_fundraiser(page)
    if target:
        progress = int(((100 * donations) / target))
        progress = max(0, min(progress, 100))
        return abe.serve_static(('percent/%dpercent.png' % progress), page['start_response'])
    else:
        donations = ('%.2f' % donations)
        path = (('/img/' + donations) + '.png')
        cpath = (abe.htdocs + path)
        if (not os.path.exists(cpath)):
            s = (donations + '    BTC')
            length = (13 * len(s))
            cmd = ('echo    "%s"    |    convert    -page    %dx20+0+0    -font    Helvetica    -style    Normal    -background    none    -undercolor    none    -fill    black    -pointsize    22    text:-    +repage    -background    none    -flatten    %s' % (s, length, cpath))
            print cmd
            os.system(cmd)
        return abe.serve_static(path, page['start_response'])
