'return embedded html'

def handle_widgets(abe, page):

    (address, donations, target, secret) = abe.get_fundraiser(page)
    if (not address):
        f = open((abe.htdocs + '/widgets.html'), 'rb')
        s = f.read()
        f.close()
        page['body'] = s
        page['title'] = 'Bitcoin    Widgets'
        return
    if secret:
        abe.do_raw(page, secret)
        page['content_type'] = 'text/html'
        return
    try:
        width = int(page['params'].get('width')[0])
    except:
        width = 400
    try:
        bg = page['params'].get('bg')[0]
    except:
        bg = '#000000'
    try:
        lc = page['params'].get('leftcolor')[0]
    except:
        lc = '#dddddd'
    try:
        rc = page['params'].get('rightcolor')[0]
    except:
        rc = '#ffaa44'
    try:
        padding = page['params'].get('padding')[0]
    except:
        padding = '3'
    try:
        radius = page['params'].get('radius')[0]
    except:
        radius = '1em'
    try:
        textcolor = page['params'].get('textcolor')[0]
    except:
        textcolor = '#000000'
    leftwidth = (width - 120)
    if target:
        progress = min(width, max(1, int(((leftwidth * donations) / target))))
        percent = min(100, max(0, int(((100 * donations) / target))))
        title = (('%d' % percent) + ('    percent    of    %.2f    BTC' % target))
    else:
        title = ''
        progress = leftwidth
    outer_style = ('border-radius:%s;    -moz-border-radius:%s;    padding:%s;    color:%s;    background-color:    %s;' % (radius, radius, padding, textcolor, bg))
    left_style = ('border-radius:%s;    -moz-border-radius:%s;    padding:%s;    background-color:    %s;' % (radius, radius, padding, lc))
    right_style = ('border-radius:%s;    -moz-border-radius:%s;    padding:%s;    background-color:    %s;    width:80px;    text-align:center;' % (radius, radius, padding, rc))
    count = ('%.2f&nbsp;BTC' % donations)
    link_count = (((((((('<a    style="text-decoration:none;color:' + textcolor) + '"    title="') + title) + '"    href="http://ecdsa.org/address/') + address) + '"    target="_blank">') + count) + '</a>')
    text = 'Donate'
    link_text = (((((('<a    style="text-decoration:none;color:' + textcolor) + '"    href="javascript:alert(\'Donate    to    this    Bitcoin    address:\\n') + address) + '\');">') + text) + '</a>')
    ret = ('<table    style="border-width:0px;"><tr><td>\n    <table    style="%s    width:%dpx;">\n        <tr><td    style="%s    width:%dpx;    text-align:center;">%s</td><td></td></tr>\n    </table>\n</td>\n<td>\n    <table    style="%s    width:100px;">\n            <tr><td    style="%s">%s</td></tr>\n    </table>\n</td></tr></table>' % (outer_style, leftwidth, left_style, progress, link_count, outer_style, right_style, link_text))
    abe.do_raw(page, ret)
    page['content_type'] = 'text/html'
