Did I find the right examples for you? yes no

All Samples(28)  |  Call(20)  |  Derive(0)  |  Import(8)
Initialize a NeededResources object in the thread-local data. Arguments
are passed verbatim to the NeededResource __init__.

        def init_needed(*args, **kw):
    """Initialize a NeededResources object in the thread-local data. Arguments
    are passed verbatim to the NeededResource __init__.
    """
    needed = NeededResources(*args, **kw)
    thread_local_needed_data.__dict__[NEEDED] = needed
    return needed
        


src/f/a/fanstatic-1.0a5/fanstatic/injector.py   fanstatic(Download)
        # environ.
        needed = fanstatic.init_needed(
            script_name=request.environ.get('SCRIPT_NAME'), **self.config)
 
        # Make sure the needed resource object is put in the WSGI

src/f/l/Flask-Fanstatic-0.2.0/flask_fanstatic.py   Flask-Fanstatic(Download)
from fanstatic import (init_needed, del_needed, Publisher, get_library_registry,
                       DEFAULT_SIGNATURE, Resource, Library, Group)
from flask import Blueprint, g, Markup, current_app, request
from werkzeug import cached_property
from werkzeug.utils import import_string
  def __init__(self, manager, **config):
    # call this first, to pop some items from the config
    self._injector = _make_injector(config)
    self._needed = init_needed(**config)
    self._manager = manager

src/f/l/flask-fanstatic-HEAD/flask_fanstatic.py   flask-fanstatic(Download)
from fanstatic import (init_needed, del_needed, Publisher, get_library_registry,
                       DEFAULT_SIGNATURE, Resource, Library, Group)
from flask import Blueprint, g, Markup, current_app, request
from werkzeug import cached_property
from werkzeug.utils import import_string
  def __init__(self, manager, **config):
    # call this first, to pop some items from the config
    self._injector = _make_injector(config)
    self._needed = init_needed(**config)
    self._manager = manager

src/p/y/pyramid_fanstatic-0.5/pyramid_fanstatic/__init__.py   pyramid_fanstatic(Download)
 
        # injector
        needed = fanstatic.init_needed(**self.config)
        if self.use_application_uri and not needed.has_base_url():
            base_url = wsgiref.util.application_uri(request.environ)

src/p/y/pyramid_fanstatic-HEAD/pyramid_fanstatic/__init__.py   pyramid_fanstatic(Download)
 
        # injector
        needed = fanstatic.init_needed(**self.config)
        if self.use_application_uri and not needed.has_base_url():
            base_url = wsgiref.util.application_uri(request.environ)

src/f/a/fanstatic-1.0a5/tests/test_core.py   fanstatic(Download)
import pytest
 
from fanstatic import (Library,
                       Resource,
                       NeededResources,
 
    # Initialize a needed resources object.
    needed = init_needed()
    assert get_needed() == needed
    assert thread_local_needed_data.__dict__[NEEDED] == needed
    y1 = Resource(foo, 'c.js', depends=[x1, x2])
 
    needed = init_needed()
    assert get_needed() == needed
    assert get_needed().resources() == set([])
    group = Group([x1, x2, y1])
 
    needed = init_needed()
    assert get_needed() == needed
    assert get_needed().resources() == set([])
    z2 = Resource(foo, 'e.js', depends=[z1, x1])
 
    needed = init_needed(resources=[y1])
 
    assert sort_resources(needed.resources()) == [x2, x1, y1]

src/f/a/fanstatic-tools-0.2/fanstatic/test_core.py   fanstatic-tools(Download)
import six
 
from fanstatic import (Library,
                       Resource,
                       NeededResources,
 
    # Initialize a needed resources object.
    needed = init_needed()
    assert get_needed() == needed
    assert thread_local_needed_data.__dict__[NEEDED] == needed
    y1 = Resource(foo, 'c.js', depends=[x1, x2])
 
    needed = init_needed()
    assert get_needed() == needed
    assert get_needed().resources() == []
    group = Group([x1, x2, y1])
 
    needed = init_needed()
    assert get_needed() == needed
    assert get_needed().resources() == []
    z2 = Resource(foo, 'e.js', depends=[z1, x1])
 
    needed = init_needed()
 
    y1.need()

src/f/a/fanstatic-1.0a5/tests/test_slot.py   fanstatic(Download)
    a = Resource(lib, 'a.js', depends=[slot])
    b = Resource(lib, 'b.js', depends=[c])
    needed = fanstatic.init_needed()
    try:
        a.need({slot: c})
    b = Resource(lib, 'b.js', depends=[c])
    g = fanstatic.Group([a, b])
    needed = fanstatic.init_needed()
    try:
        g.need({slot: c})

src/v/o/voteit.core-HEAD/voteit/core/views/tests/test_api.py   voteit.core(Download)
 
        from fanstatic import get_needed
        from fanstatic import init_needed
        from fanstatic import NeededResources
        init_needed() #Otherwise fanstatic won't get a proper needed resrouces object.

src/v/o/voteit.core-HEAD/voteit/core/tests/test_widgets.py   voteit.core(Download)
from pyramid import testing
from fanstatic import get_needed
from fanstatic import init_needed
from fanstatic import NeededResources
 
    def test_start_raiting_included(self):
        from voteit.core.fanstaticlib import _star_rating_css
        init_needed()
        obj = self._cut()
        needed = get_needed().resources()

  1 | 2  Next