def banner_image(banner, prestige, full_name=False): p = prestige while p > 3: p = p/10 i_string = '' for i in range(p): i_string = i_string + 'I' name_suffix = banner_suffix(banner) banner_subkey = _strip_banner_suffix(banner) img = BANNER_IMAGES.get(banner) or BANNER_IMAGES.get(banner_subkey) banner_text = BANNER_TEXT[banner_subkey][p-1] name = '' if img and img[1]: name = img[1] + " " + i_string if full_name and name_suffix: name = name + " (" + name_suffix + ")" if img and img[1]: name = name + ": " + banner_text if img and img[0]: filename = img[0][:-4]+("%d" % p)+img[0][-4:] return (crawl_utils.banner_link(filename), name) return img
def banner_image(banner): banner_subkey = _strip_banner_suffix(banner) img = BANNER_IMAGES.get(banner) or BANNER_IMAGES.get(banner_subkey) if img and img[0]: return (crawl_utils.banner_link(img[0]), img[1]) return img