parameters: (filename, cdn, use_minified=None, local=True)
return_statement: return resource_url
docstring: Resource finding function, also available in templates.
  
      Tries to find a resource, will force SSL depending on
      ``MATERIAL_CDN_FORCE_SSL`` settings.
  
      :param filename: File to find a URL for.
      :param cdn: Name of the CDN to use.
      :param use_minified': If set to ``True``/``False``, use/don't use
                            minified. If ``None``, honors
                            ``MATERIAL_USE_MINIFIED``.
      :param local: If ``True``, uses the ``local``-CDN when
                    ``MATERIAL_SERVE_LOCAL`` is enabled. If ``False``, uses
                    the ``static``-CDN instead.
      :return: A URL.
docstring_summary: Resource finding function, also available in templates.
docstring_tokens: Resource finding function also available in templates .
function: def material_find_resource(filename, cdn, use_minified=None, local=True):
      """Resource finding function, also available in templates.
  
      Tries to find a resource, will force SSL depending on
      ``MATERIAL_CDN_FORCE_SSL`` settings.
  
      :param filename: File to find a URL for.
      :param cdn: Name of the CDN to use.
      :param use_minified': If set to ``True``/``False``, use/don't use
                            minified. If ``None``, honors
                            ``MATERIAL_USE_MINIFIED``.
      :param local: If ``True``, uses the ``local``-CDN when
                    ``MATERIAL_SERVE_LOCAL`` is enabled. If ``False``, uses
                    the ``static``-CDN instead.
      :return: A URL.
      """
      config = current_app.config
  
      if config['MATERIAL_SERVE_LOCAL']:
          if 'css/' not in filename and 'js/' not in filename:
              filename = 'js/' + filename
  
      if None == use_minified:
          use_minified = config['MATERIAL_USE_MINIFIED']
  
      if use_minified:
          filename = '%s.min.%s' % tuple(filename.rsplit('.', 1))
  
      cdns = current_app.extensions['material']['cdns']
      resource_url = cdns[cdn].get_resource_url(filename)
  
      if resource_url.startswith('//') and config['MATERIAL_CDN_FORCE_SSL']:
          resource_url = 'https:%s' % resource_url
  
      return resource_url
function_tokens: def material_find_resource ( filename , cdn , use_minified = None , local = True ) : config = current_app . config if config [ 'MATERIAL_SERVE_LOCAL' ] : if 'css/' not in filename and 'js/' not in filename : filename = 'js/' + filename if None == use_minified : use_minified = config [ 'MATERIAL_USE_MINIFIED' ] if use_minified : filename = '%s.min.%s' % tuple ( filename . rsplit ( '.' , 1 ) ) cdns = current_app . extensions [ 'material' ] [ 'cdns' ] resource_url = cdns [ cdn ] . get_resource_url ( filename ) if resource_url . startswith ( '//' ) and config [ 'MATERIAL_CDN_FORCE_SSL' ] : resource_url = 'https:%s' % resource_url return resource_url