summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-07-17 22:45:38 +0000
committerianb <devnull@localhost>2005-07-17 22:45:38 +0000
commitc73d708616767e7bd141d8ffd9ef3ce94f8597e9 (patch)
treed7f34ceb4930cd1d54341f674a10098153796bd1
parent8a706638c7bc021adb3fa4b9de286d041d4b05e5 (diff)
downloadpaste-c73d708616767e7bd141d8ffd9ef3ce94f8597e9.tar.gz
Forgot that we put in builders, not actual functions
-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,