1. fanstatic
  2. fanstatic
  3. fanstatic
Issue #76 resolved

Support serving from none site root locations

tobes_
created an issue

Hi,

This is the same request as shown here

https://bitbucket.org/fanstatic/fanstatic/pull-request/1/support-wsgi-apps-not-mounted-at#chg-fanstatic/injector.py

but a smaller less invasive patch.

I am planning to move a project to use fanstatic and this is a definite requirement. I'd really like to see this make it into a new version of fanstatic on pypi so that we can make use of this library. We do not want to carry a patched copy if at all possible.

Thanks

{{{ --- a/fanstatic/core.py Sat May 05 18:17:04 2012 +0100 +++ b/fanstatic/core.py Sat May 05 18:39:58 2012 +0100 @@ -711,6 +711,7 @@ publisher_signature=DEFAULT_SIGNATURE, bundle=False, resources=None, + environ=None, ): self._versioning = versioning if versioning_use_md5: @@ -726,6 +727,7 @@ self._rollup = rollup self._bundle = bundle self._resources = set(resources or []) + self._environ = environ or {} self._slots = {} self._url_cache = {} # prevent multiple computations per request if (debug and minified): @@ -822,7 +824,7 @@

     :param library: A :py:class:`Library` instance.
     """
  • path = [self._base_url or '']
  • path = [self._base_url or self._environ.get('SCRIPT_NAME', '')] if self._publisher_signature: path.append(self._publisher_signature) path.append(library.name) diff -r 4fa0fe482eaa fanstatic/injector.py --- a/fanstatic/injector.py Sat May 05 18:17:04 2012 +0100 +++ b/fanstatic/injector.py Sat May 05 18:39:58 2012 +0100 @@ -41,7 +41,7 @@ # XXX this will set the needed on the thread local data, even # if the wrapped framework only gets the needed from the WSGI # environ.
  • needed = fanstatic.init_needed(**self.config)
  • needed = fanstatic.init_needed(environ=request.environ, **self.config)

     # Make sure the needed resource object is put in the WSGI
     # environment as well, for frameworks that choose to use it
    

}}}

Comments (1)

  1. Log in to comment