Esempio n. 1
0
def compile_weather():
    #
    data = info_metoffice().createForecast()
    #
    try:
        return ast.literal_eval(data)
    except:
        return data
def create_weather(user):
    body = ''
    #
    # TODO - create object to get html - temporary until create queue for item
    m = metoffice.info_metoffice()
    body = m.getHtml(user)
    #
    return urlopen('web/html/header.html').read().encode('utf-8').format(title='Weather') +\
           html_menu(user) +\
           urlopen('web/html/body.html').read().encode('utf-8').format(header='Weather', body=body) +\
           urlopen('web/html/footer.html').read().encode('utf-8')