How to use the clldutils.svg.data_url function in clldutils

To help you get started, we’ve selected a few clldutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github clld / glottolog3 / glottolog3 / __init__.py View on Github external
def __call__(self, ctx, req):
        if IValueSet.providedBy(ctx):
            if ctx.values and ctx.values[0].domainelement:
                if 'icon' in ctx.values[0].domainelement.jsondatadict:
                    return svg.data_url(svg.icon(ctx.values[0].domainelement.jsondata['icon']))
        if IDomainElement.providedBy(ctx):
            if 'icon' in ctx.jsondatadict:
                return svg.data_url(svg.icon(ctx.jsondata['icon']))
        return super(GlottologMapMarker, self).__call__(ctx, req)