def write_html(genres): template = Template(file="html.tmpl") for genre in genres.values(): #print "Writing " + genre.clean_name template.genres = genres template.this_genre = genre out = open("html/" + genre.clean_name + ".html", "w") out.write(str(template)) out.close()
#fetch_listener_stats(artists, network) pass except httplib.BadStatusLine: print "retrying" while True: try: fetch_listener_stats(artists, network, True) except: print "-> retrying" continue break save_stats(artists, "stats.bin") normalize_stats(artists) write_html(genres) # Test template = Template(file="all.tmpl") template.genres = genres template.artists = artists out = open("html/all.html", "w") out.write(str(template)) out.close() #tag_all(songs, network, subdir=SUB_DIRECTORY, translate=TRANSLATE_TAGS, whitelist=TAG_WHITELIST, min_weight=TAG_MIN_WEIGHT)