Did I find the right examples for you? yes no

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)
Register a renderer function for a given filename extension.

:param extension: the filename extension to register the
  renderer for.

:param renderer: a callable that should accept a URL argument
  and return a rendered HTML snippet for this resource.

:param order: optionally, to control the order in which the
  snippets are included in the HTML document. If no order is(more...)

src/f/a/fanstatic-1.0a5/tests/test_core.py   fanstatic(Download)
import pytest
 
from fanstatic import (Library,
                       Resource,
                       NeededResources,
        return '<link rel="unknown" href="%s" />' % url
 
    register_inclusion_renderer('.unknown', render_unknown)
    a = Resource(foo, 'nothing.unknown')
 
        return '<unknown href="%s"/>' % url
 
    register_inclusion_renderer('.later', render_unknown, 50)
    a = Resource(foo, 'nothing.later')
    b = Resource(foo, 'something.js')
    assert sort_resources([a, b, c, d]) == [c, b, d, a]
 
    register_inclusion_renderer('.sooner', render_unknown, 5)
    e = Resource(foo, 'nothing.sooner')
    assert sort_resources([a, b, c, d, e]) == [e, c, b, d, a]
 
    register_inclusion_renderer('.between', render_unknown, 25)

src/f/a/fanstatic-tools-0.2/fanstatic/test_core.py   fanstatic-tools(Download)
import six
 
from fanstatic import (Library,
                       Resource,
                       NeededResources,
        return '<link rel="unknown" href="%s" />' % url
 
    register_inclusion_renderer('.unknown', render_unknown)
    a = Resource(foo, 'nothing.unknown')
 
        return '<unknown href="%s"/>' % url
 
    register_inclusion_renderer('.later', render_unknown, 50)
    a = Resource(foo, 'nothing.later')
    b = Resource(foo, 'something.js')
<unknown href="/fanstatic/foo/nothing.later"/>"""
 
    register_inclusion_renderer('.sooner', render_unknown, 5)
    e = Resource(foo, 'nothing.sooner')
    needed.need(e)
<unknown href="/fanstatic/foo/nothing.later"/>"""
 
    register_inclusion_renderer('.between', render_unknown, 25)
    f = Resource(foo, 'nothing.between')
    needed.need(f)