def gen_champ_top_block(data): top_guides_html = '' top_guides = sorted(data[0].items(), key=lambda g: g[1][1], reverse=True) guide_index = 0 for g in top_guides: if guide_index % 2 == 0: top_guides_html += genpages.getGuideHtml(g) guide_index += 1 top_guides_html += '</div> <!-- col1 -->\n<div class="span4"> <!-- col 2 -->\n' top_guides_html += '<h2> </h2>\n' guide_index = 0 for g in top_guides: if guide_index % 2 == 1: top_guides_html += genpages.getGuideHtml(g) guide_index += 1 return top_guides_html
def gen_champ_new_block(data): new_guides_html = '' new_guides = sorted(data[1].items(), key=lambda g: g[1][2]) guide_index = 0 for g in new_guides: if guide_index % 2 == 0: new_guides_html += genpages.getGuideHtml(g) guide_index += 1 new_guides_html += '</div> <!-- col1 -->\n<div class="span4"> <!-- col 2 -->\n' new_guides_html += '<h2> </h2>\n' guide_index = 0 for g in new_guides: if guide_index % 2 == 1: new_guides_html += getGuideHtml(g) guide_index += 1 return new_guides_html