summaryrefslogtreecommitdiff
path: root/paste/urlparser.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-12-13 07:53:04 +0000
committerianb <devnull@localhost>2005-12-13 07:53:04 +0000
commitdbe3f4522a070f8b2728f252cff0b6fde148b3f0 (patch)
tree152c1eecf372d8f258122695f9bbb9f24552045e /paste/urlparser.py
parent33111b10c035575d7b59b81da8a83593a4cf5416 (diff)
downloadpaste-dbe3f4522a070f8b2728f252cff0b6fde148b3f0.tar.gz
Added entry point for pkg_resources file serving
Diffstat (limited to 'paste/urlparser.py')
-rw-r--r--paste/urlparser.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/paste/urlparser.py b/paste/urlparser.py
index be7b0ae..64e2dcd 100644
--- a/paste/urlparser.py
+++ b/paste/urlparser.py
@@ -531,3 +531,12 @@ class PkgResourcesParser(StaticURLParser):
start_response('200 OK',
[('content-type', type)])
return wsgilib._FileIter(file)
+
+def make_pkg_resources(global_conf, egg, resource_name=''):
+ """
+ A static file parser that loads data from an egg using
+ ``pkg_resources``. Takes a configuration value ``egg``, which is
+ an egg spec, and a base ``resource_name`` (default empty string)
+ which is the path in the egg that this starts at.
+ """
+ return PkgResourcesParser(egg, resource_name)