[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/PageTemplates/ Merge from trunk:
Log message for revision 68452: Merge from trunk: Log message for revision 68451: Allow access to ZopeIterator/PathIterator API from restricted Python (e.g. python expressions) Changed: U Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py U Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testExpressions.py -=- Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py === --- Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2006-06-01 20:26:48 UTC (rev 68451) +++ Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2006-06-01 20:28:04 UTC (rev 68452) @@ -152,6 +152,10 @@ class ZopeIterator(Iterator): +# allow iterator API to be accessed from (restricted) Python TALES +# expressions +__allow_access_to_unprotected_subobjects__ = True + # The things below used to be attributes in # ZTUtils.Iterator.Iterator, however in zope.tales.tales.Iterator # they're methods. We need BBB on the Python level so we redefine Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testExpressions.py === --- Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testExpressions.py 2006-06-01 20:26:48 UTC (rev 68451) +++ Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testExpressions.py 2006-06-01 20:28:04 UTC (rev 68452) @@ -69,6 +69,14 @@ assert ec.evaluate('x | string:$one') == '1' assert ec.evaluate('x | not:exists:x') +def testIteratorZRPythonExpr(self): +'''Test access to iterator functions from Python expressions''' +ec = self.ec +ec.beginScope() +ec.setRepeat('loop', "python:[1,2,3]") +assert ec.evaluate("python:repeat['loop'].even()") +ec.endScope() + def testWrappers(self): """Test if defer and lazy are returning their wrappers """ ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/ Allow access to ZopeIterator/PathIterator API from restricted Python
Log message for revision 68451: Allow access to ZopeIterator/PathIterator API from restricted Python (e.g. python expressions) Changed: U Zope/trunk/lib/python/Products/PageTemplates/Expressions.py U Zope/trunk/lib/python/Products/PageTemplates/tests/testExpressions.py -=- Modified: Zope/trunk/lib/python/Products/PageTemplates/Expressions.py === --- Zope/trunk/lib/python/Products/PageTemplates/Expressions.py 2006-06-01 19:56:09 UTC (rev 68450) +++ Zope/trunk/lib/python/Products/PageTemplates/Expressions.py 2006-06-01 20:26:48 UTC (rev 68451) @@ -152,6 +152,10 @@ class ZopeIterator(Iterator): +# allow iterator API to be accessed from (restricted) Python TALES +# expressions +__allow_access_to_unprotected_subobjects__ = True + # The things below used to be attributes in # ZTUtils.Iterator.Iterator, however in zope.tales.tales.Iterator # they're methods. We need BBB on the Python level so we redefine Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testExpressions.py === --- Zope/trunk/lib/python/Products/PageTemplates/tests/testExpressions.py 2006-06-01 19:56:09 UTC (rev 68450) +++ Zope/trunk/lib/python/Products/PageTemplates/tests/testExpressions.py 2006-06-01 20:26:48 UTC (rev 68451) @@ -69,6 +69,14 @@ assert ec.evaluate('x | string:$one') == '1' assert ec.evaluate('x | not:exists:x') +def testIteratorZRPythonExpr(self): +'''Test access to iterator functions from Python expressions''' +ec = self.ec +ec.beginScope() +ec.setRepeat('loop', "python:[1,2,3]") +assert ec.evaluate("python:repeat['loop'].even()") +ec.endScope() + def testWrappers(self): """Test if defer and lazy are returning their wrappers """ ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ImplPython.py Use isinstance, like the C implementation.
Log message for revision 68449: Use isinstance, like the C implementation. Changed: U Zope/trunk/lib/python/AccessControl/ImplPython.py -=- Modified: Zope/trunk/lib/python/AccessControl/ImplPython.py === --- Zope/trunk/lib/python/AccessControl/ImplPython.py 2006-06-01 16:29:40 UTC (rev 68448) +++ Zope/trunk/lib/python/AccessControl/ImplPython.py 2006-06-01 16:30:15 UTC (rev 68449) @@ -317,9 +317,8 @@ None) if p is not None: -tp = p.__class__ -if tp is not int and tp is not bool: -if tp is dict: +if not isinstance(p, int): # catches bool too +if isinstance(p, dict): if isinstance(name, basestring): p = p.get(name) else: ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/AccessControl/ImplPython.py Use isinstance, like the C implementation.
Log message for revision 68448: Use isinstance, like the C implementation. Changed: U Zope/branches/2.10/lib/python/AccessControl/ImplPython.py -=- Modified: Zope/branches/2.10/lib/python/AccessControl/ImplPython.py === --- Zope/branches/2.10/lib/python/AccessControl/ImplPython.py 2006-06-01 16:08:52 UTC (rev 68447) +++ Zope/branches/2.10/lib/python/AccessControl/ImplPython.py 2006-06-01 16:29:40 UTC (rev 68448) @@ -317,9 +317,8 @@ None) if p is not None: -tp = p.__class__ -if tp is not int and tp is not bool: -if tp is dict: +if not isinstance(p, int): # catches bool too +if isinstance(p, dict): if isinstance(name, basestring): p = p.get(name) else: ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/AccessControl/ Make python security policy work with a boolean __aatus__
Log message for revision 68447: Make python security policy work with a boolean __aatus__ Changed: U Zope/branches/2.9/lib/python/AccessControl/ImplPython.py U Zope/branches/2.9/lib/python/AccessControl/tests/testZopeSecurityPolicy.py -=- Modified: Zope/branches/2.9/lib/python/AccessControl/ImplPython.py === --- Zope/branches/2.9/lib/python/AccessControl/ImplPython.py2006-06-01 14:48:15 UTC (rev 68446) +++ Zope/branches/2.9/lib/python/AccessControl/ImplPython.py2006-06-01 16:08:52 UTC (rev 68447) @@ -317,7 +317,7 @@ if p is not None: tp = p.__class__ -if tp is not int: +if tp is not int and tp is not bool: if tp is dict: if isinstance(name, basestring): p = p.get(name) Modified: Zope/branches/2.9/lib/python/AccessControl/tests/testZopeSecurityPolicy.py === --- Zope/branches/2.9/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 14:48:15 UTC (rev 68446) +++ Zope/branches/2.9/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 16:08:52 UTC (rev 68447) @@ -113,6 +113,11 @@ __allow_access_to_unprotected_subobjects__ = 1 +class UnprotectedSimpleItemBool (SimpleItemish): + +__allow_access_to_unprotected_subobjects__ = True + + class OwnedSimpleItem(UnprotectedSimpleItem): def getOwner(self, info=0): if info: @@ -159,6 +164,7 @@ a = App() self.a = a a.item = UnprotectedSimpleItem() +a.itemb = UnprotectedSimpleItemBool() self.item = a.item a.r_item = RestrictedSimpleItem() a.item1 = PartlyProtectedSimpleItem1() @@ -237,11 +243,13 @@ def testAccessToUnprotectedSubobjects(self): item = self.item +itemb = self.a.itemb r_item = self.a.r_item item1 = self.a.item1 item2 = self.a.item2 item3 = self.a.item3 self.assertPolicyAllows(item, 'public_prop') +self.assertPolicyAllows(itemb, 'public_prop') self.assertPolicyDenies(r_item,'public_prop') self.assertPolicyAllows(item1, 'public_prop') self.assertPolicyAllows(item2, 'public_prop') ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ Make python security policy work with a boolean __aatus__
Log message for revision 68446: Make python security policy work with a boolean __aatus__ Changed: U Zope/trunk/lib/python/AccessControl/ImplPython.py U Zope/trunk/lib/python/AccessControl/tests/testZopeSecurityPolicy.py -=- Modified: Zope/trunk/lib/python/AccessControl/ImplPython.py === --- Zope/trunk/lib/python/AccessControl/ImplPython.py 2006-06-01 14:46:17 UTC (rev 68445) +++ Zope/trunk/lib/python/AccessControl/ImplPython.py 2006-06-01 14:48:15 UTC (rev 68446) @@ -318,7 +318,7 @@ if p is not None: tp = p.__class__ -if tp is not int: +if tp is not int and tp is not bool: if tp is dict: if isinstance(name, basestring): p = p.get(name) Modified: Zope/trunk/lib/python/AccessControl/tests/testZopeSecurityPolicy.py === --- Zope/trunk/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 14:46:17 UTC (rev 68445) +++ Zope/trunk/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 14:48:15 UTC (rev 68446) @@ -113,6 +113,11 @@ __allow_access_to_unprotected_subobjects__ = 1 +class UnprotectedSimpleItemBool (SimpleItemish): + +__allow_access_to_unprotected_subobjects__ = True + + class OwnedSimpleItem(UnprotectedSimpleItem): def getOwner(self, info=0): if info: @@ -159,6 +164,7 @@ a = App() self.a = a a.item = UnprotectedSimpleItem() +a.itemb = UnprotectedSimpleItemBool() self.item = a.item a.r_item = RestrictedSimpleItem() a.item1 = PartlyProtectedSimpleItem1() @@ -237,11 +243,13 @@ def testAccessToUnprotectedSubobjects(self): item = self.item +itemb = self.a.itemb r_item = self.a.r_item item1 = self.a.item1 item2 = self.a.item2 item3 = self.a.item3 self.assertPolicyAllows(item, 'public_prop') +self.assertPolicyAllows(itemb, 'public_prop') self.assertPolicyDenies(r_item,'public_prop') self.assertPolicyAllows(item1, 'public_prop') self.assertPolicyAllows(item2, 'public_prop') ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py Revert unwanted checkin.
Log message for revision 68445: Revert unwanted checkin. Changed: U Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py -=- Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py === --- Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2006-06-01 14:44:13 UTC (rev 68444) +++ Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2006-06-01 14:46:17 UTC (rev 68445) @@ -99,8 +99,6 @@ class ZopePathExpr(PathExpr): def __init__(self, name, expr, engine): -if name == 'standard' and not expr: -expr = 'nothing' super(ZopePathExpr, self).__init__(name, expr, engine, boboAwareZopeTraverse) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/ Make python security policy work with a boolean __aatus__
Log message for revision 68444: Make python security policy work with a boolean __aatus__ Changed: U Zope/branches/2.10/lib/python/AccessControl/ImplPython.py U Zope/branches/2.10/lib/python/AccessControl/tests/testZopeSecurityPolicy.py U Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py -=- Modified: Zope/branches/2.10/lib/python/AccessControl/ImplPython.py === --- Zope/branches/2.10/lib/python/AccessControl/ImplPython.py 2006-06-01 14:18:32 UTC (rev 68443) +++ Zope/branches/2.10/lib/python/AccessControl/ImplPython.py 2006-06-01 14:44:13 UTC (rev 68444) @@ -318,7 +318,7 @@ if p is not None: tp = p.__class__ -if tp is not int: +if tp is not int and tp is not bool: if tp is dict: if isinstance(name, basestring): p = p.get(name) Modified: Zope/branches/2.10/lib/python/AccessControl/tests/testZopeSecurityPolicy.py === --- Zope/branches/2.10/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 14:18:32 UTC (rev 68443) +++ Zope/branches/2.10/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 14:44:13 UTC (rev 68444) @@ -113,6 +113,11 @@ __allow_access_to_unprotected_subobjects__ = 1 +class UnprotectedSimpleItemBool (SimpleItemish): + +__allow_access_to_unprotected_subobjects__ = True + + class OwnedSimpleItem(UnprotectedSimpleItem): def getOwner(self, info=0): if info: @@ -159,6 +164,7 @@ a = App() self.a = a a.item = UnprotectedSimpleItem() +a.itemb = UnprotectedSimpleItemBool() self.item = a.item a.r_item = RestrictedSimpleItem() a.item1 = PartlyProtectedSimpleItem1() @@ -237,11 +243,13 @@ def testAccessToUnprotectedSubobjects(self): item = self.item +itemb = self.a.itemb r_item = self.a.r_item item1 = self.a.item1 item2 = self.a.item2 item3 = self.a.item3 self.assertPolicyAllows(item, 'public_prop') +self.assertPolicyAllows(itemb, 'public_prop') self.assertPolicyDenies(r_item,'public_prop') self.assertPolicyAllows(item1, 'public_prop') self.assertPolicyAllows(item2, 'public_prop') Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py === --- Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2006-06-01 14:18:32 UTC (rev 68443) +++ Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2006-06-01 14:44:13 UTC (rev 68444) @@ -99,6 +99,8 @@ class ZopePathExpr(PathExpr): def __init__(self, name, expr, engine): +if name == 'standard' and not expr: +expr = 'nothing' super(ZopePathExpr, self).__init__(name, expr, engine, boboAwareZopeTraverse) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZGadflyDA/__init__.py Don't warn when the ZGadflyDA is imported by Zope startup code.
Log message for revision 68441: Don't warn when the ZGadflyDA is imported by Zope startup code. Changed: U Zope/trunk/lib/python/Products/ZGadflyDA/__init__.py -=- Modified: Zope/trunk/lib/python/Products/ZGadflyDA/__init__.py === --- Zope/trunk/lib/python/Products/ZGadflyDA/__init__.py2006-06-01 12:17:15 UTC (rev 68440) +++ Zope/trunk/lib/python/Products/ZGadflyDA/__init__.py2006-06-01 12:18:11 UTC (rev 68441) @@ -15,11 +15,14 @@ $Id$ """ -import warnings -warnings.warn('Using Gadfly and ZGadflyDA is deprecated. The module will be ' - 'removed in Zope 2.11)', - DeprecationWarning, - stacklevel=2) +# Don't warn when the product is imported by the startup code +import sys +if sys._getframe(1).f_code.co_name != 'import_product': # OFS.Application +import warnings +warnings.warn('Using Gadfly and ZGadflyDA is deprecated. ' + 'The module will be removed in Zope 2.11)', + DeprecationWarning, + stacklevel=2) import Globals, os ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/ZGadflyDA/__init__.py Don't warn when the ZGadflyDA is imported by Zope startup code.
Log message for revision 68440: Don't warn when the ZGadflyDA is imported by Zope startup code. Changed: U Zope/branches/2.10/lib/python/Products/ZGadflyDA/__init__.py -=- Modified: Zope/branches/2.10/lib/python/Products/ZGadflyDA/__init__.py === --- Zope/branches/2.10/lib/python/Products/ZGadflyDA/__init__.py 2006-06-01 11:59:22 UTC (rev 68439) +++ Zope/branches/2.10/lib/python/Products/ZGadflyDA/__init__.py 2006-06-01 12:17:15 UTC (rev 68440) @@ -15,11 +15,14 @@ $Id$ """ -import warnings -warnings.warn('Using Gadfly and ZGadflyDA is deprecated. The module will be ' - 'removed in Zope 2.11)', - DeprecationWarning, - stacklevel=2) +# Don't warn when the product is imported by the startup code +import sys +if sys._getframe(1).f_code.co_name != 'import_product': # OFS.Application +import warnings +warnings.warn('Using Gadfly and ZGadflyDA is deprecated. ' + 'The module will be removed in Zope 2.11)', + DeprecationWarning, + stacklevel=2) import Globals, os ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/App/Product.py Removed a warning at Zope startup.
Log message for revision 68439: Removed a warning at Zope startup. Changed: U Zope/trunk/lib/python/App/Product.py -=- Modified: Zope/trunk/lib/python/App/Product.py === --- Zope/trunk/lib/python/App/Product.py2006-06-01 11:58:47 UTC (rev 68438) +++ Zope/trunk/lib/python/App/Product.py2006-06-01 11:59:22 UTC (rev 68439) @@ -42,7 +42,7 @@ import Globals, OFS.Folder, OFS.SimpleItem, Acquisition, Products from Globals import InitializeClass -import ZClasses, AccessControl.Owned +import AccessControl.Owned from OFS.Folder import Folder from HelpSys.HelpSys import ProductHelp from AccessControl import Unauthorized @@ -53,6 +53,17 @@ import RefreshFuncs from App.config import getConfiguration +# BBB: ZClasses are deprecated but we don't want the warning to appear here +import warnings +warnings.filterwarnings('ignore', message='^ZClasses', append=1) +try: +import ZClasses +finally: +del warnings.filters[-1] +try: +del __warningregistry__ +except NameError: +pass class ProductFolder(Folder): "Manage a collection of Products" ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/App/Product.py Removed a warning at Zope startup.
Log message for revision 68438: Removed a warning at Zope startup. Changed: U Zope/branches/2.10/lib/python/App/Product.py -=- Modified: Zope/branches/2.10/lib/python/App/Product.py === --- Zope/branches/2.10/lib/python/App/Product.py2006-06-01 11:57:17 UTC (rev 68437) +++ Zope/branches/2.10/lib/python/App/Product.py2006-06-01 11:58:47 UTC (rev 68438) @@ -42,7 +42,7 @@ import Globals, OFS.Folder, OFS.SimpleItem, Acquisition, Products from Globals import InitializeClass -import ZClasses, AccessControl.Owned +import AccessControl.Owned from OFS.Folder import Folder from HelpSys.HelpSys import ProductHelp from AccessControl import Unauthorized @@ -53,6 +53,17 @@ import RefreshFuncs from App.config import getConfiguration +# BBB: ZClasses are deprecated but we don't want the warning to appear here +import warnings +warnings.filterwarnings('ignore', message='^ZClasses', append=1) +try: +import ZClasses +finally: +del warnings.filters[-1] +try: +del __warningregistry__ +except NameError: +pass class ProductFolder(Folder): "Manage a collection of Products" ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PluginIndexes/__init__.py More robust.
Log message for revision 68437: More robust. Changed: U Zope/trunk/lib/python/Products/PluginIndexes/__init__.py -=- Modified: Zope/trunk/lib/python/Products/PluginIndexes/__init__.py === --- Zope/trunk/lib/python/Products/PluginIndexes/__init__.py2006-06-01 11:56:50 UTC (rev 68436) +++ Zope/trunk/lib/python/Products/PluginIndexes/__init__.py2006-06-01 11:57:17 UTC (rev 68437) @@ -29,7 +29,10 @@ import TextIndex.TextIndex finally: del warnings.filters[-1] -del __warningregistry__ +try: +del __warningregistry__ +except NameError: +pass _indexes = ('TextIndex', 'KeywordIndex', ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py More robust.
Log message for revision 68436: More robust. Changed: U Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py -=- Modified: Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py === --- Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py 2006-06-01 11:56:36 UTC (rev 68435) +++ Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py 2006-06-01 11:56:50 UTC (rev 68436) @@ -29,7 +29,10 @@ import TextIndex.TextIndex finally: del warnings.filters[-1] -del __warningregistry__ +try: +del __warningregistry__ +except NameError: +pass _indexes = ('TextIndex', 'KeywordIndex', ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZCatalog/__init__.py More robust.
Log message for revision 68435: More robust. Changed: U Zope/trunk/lib/python/Products/ZCatalog/__init__.py -=- Modified: Zope/trunk/lib/python/Products/ZCatalog/__init__.py === --- Zope/trunk/lib/python/Products/ZCatalog/__init__.py 2006-06-01 11:56:03 UTC (rev 68434) +++ Zope/trunk/lib/python/Products/ZCatalog/__init__.py 2006-06-01 11:56:36 UTC (rev 68435) @@ -23,7 +23,10 @@ from ZClasses import createZClassForBase finally: del warnings.filters[-1] -del __warningregistry__ +try: +del __warningregistry__ +except NameError: +pass createZClassForBase( ZCatalog.ZCatalog , globals() , 'ZCatalogBase', 'ZCatalog' ) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py More robust.
Log message for revision 68434: More robust. Changed: U Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py -=- Modified: Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py === --- Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py 2006-06-01 11:53:33 UTC (rev 68433) +++ Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py 2006-06-01 11:56:03 UTC (rev 68434) @@ -23,7 +23,10 @@ from ZClasses import createZClassForBase finally: del warnings.filters[-1] -del __warningregistry__ +try: +del __warningregistry__ +except NameError: +pass createZClassForBase( ZCatalog.ZCatalog , globals() , 'ZCatalogBase', 'ZCatalog' ) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZCatalog/__init__.py Removed a warning at Zope startup.
Log message for revision 68433: Removed a warning at Zope startup. Changed: U Zope/trunk/lib/python/Products/ZCatalog/__init__.py -=- Modified: Zope/trunk/lib/python/Products/ZCatalog/__init__.py === --- Zope/trunk/lib/python/Products/ZCatalog/__init__.py 2006-06-01 11:52:56 UTC (rev 68432) +++ Zope/trunk/lib/python/Products/ZCatalog/__init__.py 2006-06-01 11:53:33 UTC (rev 68433) @@ -15,8 +15,16 @@ import ZCatalog, CatalogAwareness, CatalogPathAwareness from Products.PluginIndexes.TextIndex import Vocabulary -from ZClasses import createZClassForBase +# BBB: ZClasses are deprecated but we don't want the warning to appear here +import warnings +warnings.filterwarnings('ignore', message='^ZClasses', append=1) +try: +from ZClasses import createZClassForBase +finally: +del warnings.filters[-1] +del __warningregistry__ + createZClassForBase( ZCatalog.ZCatalog , globals() , 'ZCatalogBase', 'ZCatalog' ) createZClassForBase( CatalogAwareness.CatalogAware, globals() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py Removed a warning at Zope startup.
Log message for revision 68432: Removed a warning at Zope startup. Changed: U Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py -=- Modified: Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py === --- Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py 2006-06-01 11:50:02 UTC (rev 68431) +++ Zope/branches/2.10/lib/python/Products/ZCatalog/__init__.py 2006-06-01 11:52:56 UTC (rev 68432) @@ -15,8 +15,16 @@ import ZCatalog, CatalogAwareness, CatalogPathAwareness from Products.PluginIndexes.TextIndex import Vocabulary -from ZClasses import createZClassForBase +# BBB: ZClasses are deprecated but we don't want the warning to appear here +import warnings +warnings.filterwarnings('ignore', message='^ZClasses', append=1) +try: +from ZClasses import createZClassForBase +finally: +del warnings.filters[-1] +del __warningregistry__ + createZClassForBase( ZCatalog.ZCatalog , globals() , 'ZCatalogBase', 'ZCatalog' ) createZClassForBase( CatalogAwareness.CatalogAware, globals() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PluginIndexes/__init__.py Removed a warning at Zope startup.
Log message for revision 68431: Removed a warning at Zope startup. Changed: U Zope/trunk/lib/python/Products/PluginIndexes/__init__.py -=- Modified: Zope/trunk/lib/python/Products/PluginIndexes/__init__.py === --- Zope/trunk/lib/python/Products/PluginIndexes/__init__.py2006-06-01 11:48:09 UTC (rev 68430) +++ Zope/trunk/lib/python/Products/PluginIndexes/__init__.py2006-06-01 11:50:02 UTC (rev 68431) @@ -16,13 +16,21 @@ import common.UnIndexas UnIndex import PathIndex.PathIndex -import TextIndex.TextIndex import FieldIndex.FieldIndex import KeywordIndex.KeywordIndex import TopicIndex.TopicIndex import DateIndex.DateIndex import DateRangeIndex.DateRangeIndex +# BBB: TextIndex is deprecated but we don't want the warning to appear here +import warnings +warnings.filterwarnings('ignore', message='^Using TextIndex', append=1) +try: +import TextIndex.TextIndex +finally: +del warnings.filters[-1] +del __warningregistry__ + _indexes = ('TextIndex', 'KeywordIndex', 'FieldIndex', ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py Removed a warning at Zope startup.
Log message for revision 68430: Removed a warning at Zope startup. Changed: U Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py -=- Modified: Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py === --- Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py 2006-06-01 10:54:18 UTC (rev 68429) +++ Zope/branches/2.10/lib/python/Products/PluginIndexes/__init__.py 2006-06-01 11:48:09 UTC (rev 68430) @@ -16,13 +16,21 @@ import common.UnIndexas UnIndex import PathIndex.PathIndex -import TextIndex.TextIndex import FieldIndex.FieldIndex import KeywordIndex.KeywordIndex import TopicIndex.TopicIndex import DateIndex.DateIndex import DateRangeIndex.DateRangeIndex +# BBB: TextIndex is deprecated but we don't want the warning to appear here +import warnings +warnings.filterwarnings('ignore', message='^Using TextIndex', append=1) +try: +import TextIndex.TextIndex +finally: +del warnings.filters[-1] +del __warningregistry__ + _indexes = ('TextIndex', 'KeywordIndex', 'FieldIndex', ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py Merged r68427 from 2.10 branch:
Log message for revision 68428: Merged r68427 from 2.10 branch: Removed a warning at Zope startup. Changed: U Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py -=- Modified: Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py === --- Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py 2006-06-01 10:36:10 UTC (rev 68427) +++ Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py 2006-06-01 10:40:02 UTC (rev 68428) @@ -37,7 +37,6 @@ from Products.PluginIndexes.common.PluggableIndex \ import PluggableIndexInterface from Products.PluginIndexes.interfaces import IPluggableIndex -from Products.PluginIndexes.TextIndex import Splitter from zope.interface import implements from Catalog import Catalog, CatalogError @@ -508,9 +507,12 @@ '?manage_tabs_message=Reindexing%20Performed') +# BBB: will be removed in Zope 2.12 (like TextIndex itself) security.declareProtected(manage_zcatalog_entries, 'availableSplitters') def availableSplitters(self): """ splitter we can add """ +# This import will trigger a deprecation warning about TextIndex +from Products.PluginIndexes.TextIndex import Splitter return Splitter.availableSplitters ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py Removed a warning at Zope startup.
Log message for revision 68427: Removed a warning at Zope startup. Changed: U Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py -=- Modified: Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py === --- Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py 2006-06-01 09:25:43 UTC (rev 68426) +++ Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py 2006-06-01 10:36:10 UTC (rev 68427) @@ -37,7 +37,6 @@ from Products.PluginIndexes.common.PluggableIndex \ import PluggableIndexInterface from Products.PluginIndexes.interfaces import IPluggableIndex -from Products.PluginIndexes.TextIndex import Splitter from zope.interface import implements from Catalog import Catalog, CatalogError @@ -508,9 +507,12 @@ '?manage_tabs_message=Reindexing%20Performed') +# BBB: will be removed in Zope 2.12 (like TextIndex itself) security.declareProtected(manage_zcatalog_entries, 'availableSplitters') def availableSplitters(self): """ splitter we can add """ +# This import will trigger a deprecation warning about TextIndex +from Products.PluginIndexes.TextIndex import Splitter return Splitter.availableSplitters ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins