def sprite_url(map, cache_buster=True):
    """
    Returns a url to the sprite image.
    """
    map = map.render()
    sprite_maps = _get_cache('sprite_maps')
    sprite_map = sprite_maps.get(map)
    if not sprite_map:
        log.error("No sprite map found: %s", map, extra={'stack': True})
    if sprite_map:
        url = '%s%s' % (config.ASSETS_URL, sprite_map['*f*'])
        if cache_buster:
            url += '?_=%s' % sprite_map['*t*']
        url = "url(%s)" % escape(url)
        return String.unquoted(url)
    return String.unquoted('')
def sprite_url ( map , cache_buster = True ) : map = map . render ( ) sprite_maps = _get_cache ( 'sprite_maps' ) sprite_map = sprite_maps . get ( map ) if not sprite_map : log . error ( "No sprite map found: %s" , map , extra = { 'stack' : True } ) if sprite_map : url = '%s%s' % ( config . ASSETS_URL , sprite_map [ '*f*' ] ) if cache_buster : url += '?_=%s' % sprite_map [ '*t*' ] url = "url(%s)" % escape ( url ) return String . unquoted ( url ) return String . unquoted ( '' )
Returns a url to the sprite image.