summaryrefslogtreecommitdiff
path: root/paste/pyconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'paste/pyconfig.py')
-rw-r--r--paste/pyconfig.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/paste/pyconfig.py b/paste/pyconfig.py
index a77725d..f3e254e 100644
--- a/paste/pyconfig.py
+++ b/paste/pyconfig.py
@@ -24,6 +24,11 @@ UserDict = thirdparty.load_new_module('UserDict', (2, 3))
from paste.reloader import watch_file
from paste.util.threadinglocal import local
import threading
+try:
+ import pkg_resources
+ require = pkg_resources.require
+except ImportError:
+ require = None
def load(filename):
conf = Config(with_default=True)
@@ -178,6 +183,11 @@ class Config(UserDict.DictMixin, object):
def update_sys_path(self):
update_sys_path(self.get('sys_path'), self.get('verbose'))
+if require:
+ def make_require(config, filename, namespace):
+ return require
+ Config.builtins['require'] = make_require
+
def setup_config(filename, add_config=None, conf=None):
"""
Load the configuration with all default configs also applied,