dropped pkg_resources

This commit is contained in:
Armin Ronacher 2010-07-04 12:14:00 +02:00
parent 532347d6ad
commit fedc06c295
3 changed files with 5 additions and 21 deletions

View file

@ -82,19 +82,6 @@ def jsonify(*args, **kwargs):
indent=None if request.is_xhr else 2), mimetype='application/json')
def get_pkg_resources():
"""Use pkg_resource if that works, otherwise fall back to cwd. The
current working directory is generally not reliable with the notable
exception of google appengine.
"""
try:
import pkg_resources
pkg_resources.resource_stream
except (ImportError, AttributeError):
return
return pkg_resources
def url_for(endpoint, **values):
"""Generates a URL to the given endpoint with the method provided.
The endpoint is relative to the active module if modules are in use.
@ -365,7 +352,4 @@ class _PackageBoundObject(object):
:param resource: the name of the resource. To access resources within
subfolders use forward slashes as separator.
"""
pkg_resources = get_pkg_resources()
if pkg_resources is None:
return open(os.path.join(self.root_path, resource), 'rb')
return pkg_resources.resource_stream(self.import_name, resource)
return open(os.path.join(self.root_path, resource), 'rb')