Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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