[z3-checkins] r14449 - in z3/Five/trunk: . tests
philikon at codespeak.net
philikon at codespeak.net
Sat Jul 9 23:12:25 CEST 2005
Author: philikon
Date: Sat Jul 9 23:12:22 2005
New Revision: 14449
Modified:
z3/Five/trunk/sizeconfigure.py
z3/Five/trunk/tests/test_size.py
Log:
clean up for sizable monkeys
Modified: z3/Five/trunk/sizeconfigure.py
==============================================================================
--- z3/Five/trunk/sizeconfigure.py (original)
+++ z3/Five/trunk/sizeconfigure.py Sat Jul 9 23:12:22 2005
@@ -19,6 +19,9 @@
from zope.app.size.interfaces import ISized
from Products.Five.fiveconfigure import isFiveMethod
+# holds classes that were monkeyed with; for clean up
+_monkied = []
+
def get_size(self):
size = ISized(self, None)
if size is not None:
@@ -37,6 +40,8 @@
if hasattr(class_, "get_size") and not isFiveMethod(class_.get_size):
class_.__five_original_get_size = class_.get_size
class_.get_size = get_size
+ # remember class for clean up
+ _monkied.append(class_)
def sizable(_context, class_):
_context.action(
Modified: z3/Five/trunk/tests/test_size.py
==============================================================================
--- z3/Five/trunk/tests/test_size.py (original)
+++ z3/Five/trunk/tests/test_size.py Sat Jul 9 23:12:22 2005
@@ -90,6 +90,11 @@
>>> n = manage_addFancyContent(self.folder, 'fancy', 'Fancy')
>>> self.folder.fancy.get_size()
43
+
+ Clean up:
+
+ >>> from Products.Five.sizeconfigure import cleanUp
+ >>> cleanUp()
"""
def test_suite():
More information about the z3-checkins
mailing list