From dbe3f4522a070f8b2728f252cff0b6fde148b3f0 Mon Sep 17 00:00:00 2001 From: ianb Date: Tue, 13 Dec 2005 07:53:04 +0000 Subject: Added entry point for pkg_resources file serving --- paste/urlparser.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'paste/urlparser.py') 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) -- cgit v1.2.1