summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/news.txt5
-rw-r--r--paste/registry.py10
2 files changed, 15 insertions, 0 deletions
diff --git a/docs/news.txt b/docs/news.txt
index 186f2d5..bc71326 100644
--- a/docs/news.txt
+++ b/docs/news.txt
@@ -18,6 +18,11 @@ svn trunk
* In ``paste.exceptions`` always call ``start_response``; may help
problems when there is an exception in ``start_response`` itself.
+* Added method to ``paste.registry.StackedObjectProxy``,
+ ``_object_stack()``, which returns a list of all the registered
+ objects. Useful if you want to search through the effective history
+ of a stacked object.
+
1.3
---
diff --git a/paste/registry.py b/paste/registry.py
index a58ac6f..41c1d8f 100644
--- a/paste/registry.py
+++ b/paste/registry.py
@@ -214,6 +214,16 @@ class StackedObjectProxy(object):
'The object popped (%s) is not the same as the object '
'expected (%s)' % (popped, obj))
+ def _object_stack(self):
+ """Returns all of the objects stacked in this container
+
+ (Might return [] if there are none)
+ """
+ try:
+ return self.____local__.objects[:]
+ except AssertionError:
+ return []
+
# The following methods will be swapped for their original versions by
# StackedObjectRestorer when restoration is enabled. The original
# functions (e.g. _current_obj) will be available at _current_obj_orig