summaryrefslogtreecommitdiff
path: root/paste/registry.py
diff options
context:
space:
mode:
authorpjenvey <devnull@localhost>2008-03-31 20:00:29 +0000
committerpjenvey <devnull@localhost>2008-03-31 20:00:29 +0000
commit10749266d3ae0188a2e61070690d8b50c0a99f2a (patch)
treeacb965234f9630e2385ed8dcd90dc790f7c21a59 /paste/registry.py
parentf5a873be4910cbabd2187d9212b61720eb1bf738 (diff)
downloadpaste-10749266d3ae0188a2e61070690d8b50c0a99f2a.tar.gz
have StackedObjectProxies utilize 2.6's __dir__
Diffstat (limited to 'paste/registry.py')
-rw-r--r--paste/registry.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/paste/registry.py b/paste/registry.py
index 685caae..b261981 100644
--- a/paste/registry.py
+++ b/paste/registry.py
@@ -120,6 +120,18 @@ class StackedObjectProxy(object):
self.__dict__['____local__'] = threadinglocal.local()
if default is not NoDefault:
self.__dict__['____default_object__'] = default
+
+ def __dir__(self):
+ """Return a list of the StackedObjectProxy's and proxied
+ object's (if one exists) names.
+ """
+ dir_list = dir(self.__class__) + self.__dict__.keys()
+ try:
+ dir_list.extend(dir(self._current_obj()))
+ except TypeError:
+ pass
+ dir_list.sort()
+ return dir_list
def __getattr__(self, attr):
return getattr(self._current_obj(), attr)