summaryrefslogtreecommitdiff
path: root/paste/registry.py
diff options
context:
space:
mode:
authorbbangert <devnull@localhost>2007-10-08 18:33:28 +0000
committerbbangert <devnull@localhost>2007-10-08 18:33:28 +0000
commit01398758f8fd83b91e3d7634a37d862a6ad19b34 (patch)
tree673decd2c0d27037bf95d1bd8c00a0ccb0de0528 /paste/registry.py
parent28c3f0f3f2c4b7badb44f28b17fa770fdec847c8 (diff)
downloadpaste-01398758f8fd83b91e3d7634a37d862a6ad19b34.tar.gz
Replace and register are identical, aliasing the method.
Diffstat (limited to 'paste/registry.py')
-rw-r--r--paste/registry.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/paste/registry.py b/paste/registry.py
index 216f99a..685caae 100644
--- a/paste/registry.py
+++ b/paste/registry.py
@@ -293,26 +293,14 @@ class Registry(object):
myreglist = self.reglist[-1]
stacked_id = id(stacked)
if stacked_id in myreglist:
- stacked._pop_object(myreglist[stacked_id])
- del myreglist[stacked_id]
- stacked._push_object(obj)
- myreglist[stacked_id] = (stacked, obj)
-
- def replace(self, stacked, obj):
- """Replace the object referenced by a StackedObjectProxy with a
- different object
-
- In the event that no object has been registered, the new object will
- be registered.
- """
- myreglist = self.reglist[-1]
- stacked_id = id(stacked)
- if stacked_id in myreglist:
stacked._pop_object(myreglist[stacked_id][1])
del myreglist[stacked_id]
stacked._push_object(obj)
myreglist[stacked_id] = (stacked, obj)
+ # Replace now does the same thing as register
+ replace = register
+
def cleanup(self):
"""Remove all objects from all StackedObjectProxy instances that
were tracked at this Registry context"""