def parse_licenses_for_html_render(copyright): """ Creates list of licenses with urls """ licenses = [] for par in copyright.all_license_paragraphs(): licenses.append({'synopsis': par.license.synopsis, 'link': match_license(par.license.synopsis), 'text': par.license.text, 'comment': par.comment}) return licenses
def parse_licenses_for_html_render(copyright): """Creates list of licenses with urls""" licenses = [] for par in copyright.all_license_paragraphs(): licenses.append({ "synopsis": par.license.synopsis, "link": match_license(par.license.synopsis), "text": par.license.text, "comment": par.comment, }) return licenses
def anchor_to_license(copyright, synopsis): """ Matches license into a license in the licenses paragraphs and creates an anchor link there. """ licenses = [] for par in copyright.all_license_paragraphs(): try: licenses.append(par.license.synopsis) except (AttributeError, ValueError): pass if synopsis in licenses: return '#license-' + str(licenses.index(synopsis)) else: return None