[CMF-checkins] SVN: CMF/trunk/CMF - removed some obsolete BBB code
Yvo Schubbe
y.2006_ at wcm-solutions.de
Wed Jan 18 05:11:10 EST 2006
Log message for revision 41352:
- removed some obsolete BBB code
Changed:
U CMF/trunk/CMFActionIcons/__init__.py
U CMF/trunk/CMFActionIcons/permissions.py
U CMF/trunk/CMFCore/fiveactionstool.py
U CMF/trunk/CMFCore/tests/base/testcase.py
U CMF/trunk/CMFDefault/tests/test_SyndicationTool.py
-=-
Modified: CMF/trunk/CMFActionIcons/__init__.py
===================================================================
--- CMF/trunk/CMFActionIcons/__init__.py 2006-01-18 09:13:11 UTC (rev 41351)
+++ CMF/trunk/CMFActionIcons/__init__.py 2006-01-18 10:11:09 UTC (rev 41352)
@@ -16,15 +16,12 @@
$Id$
"""
+
from Products.CMFCore.DirectoryView import registerDirectory
+from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import ToolInit
-try:
- from Products.CMFSetup import EXTENSION
- from Products.CMFSetup import profile_registry
- from Products.CMFCore.interfaces import ISiteRoot
- has_profile_registry = True
-except ImportError:
- has_profile_registry = False
+from Products.GenericSetup import EXTENSION
+from Products.GenericSetup import profile_registry
import ActionIconsTool
@@ -39,12 +36,11 @@
, icon="tool.gif"
).initialize( context )
- if has_profile_registry:
- profile_registry.registerProfile('actionicons',
- 'CMFActionIcons',
- 'Adds action icon tool / settings.',
- 'profiles/actionicons',
- 'CMFActionIcons',
- EXTENSION,
- for_=ISiteRoot,
- )
+ profile_registry.registerProfile('actionicons',
+ 'CMFActionIcons',
+ 'Adds action icon tool / settings.',
+ 'profiles/actionicons',
+ 'CMFActionIcons',
+ EXTENSION,
+ for_=ISiteRoot,
+ )
Modified: CMF/trunk/CMFActionIcons/permissions.py
===================================================================
--- CMF/trunk/CMFActionIcons/permissions.py 2006-01-18 09:13:11 UTC (rev 41351)
+++ CMF/trunk/CMFActionIcons/permissions.py 2006-01-18 10:11:09 UTC (rev 41352)
@@ -19,12 +19,7 @@
security = ModuleSecurityInfo('Products.CMFActionIcons.permissions')
security.declarePublic('ManagePortal')
-security.declarePublic('View')
+from Products.CMFCore.permissions import ManagePortal
-try:
- from Products.CMFCore.permissions import ManagePortal
- from Products.CMFCore.permissions import View
-except ImportError: # CMF < 1.5
- from Products.CMFCore.CMFCorePermissions import ManagePortal
- from Products.CMFCore.CMFCorePermissions import View
-
+security.declarePublic('View')
+from Products.CMFCore.permissions import View
Modified: CMF/trunk/CMFCore/fiveactionstool.py
===================================================================
--- CMF/trunk/CMFCore/fiveactionstool.py 2006-01-18 09:13:11 UTC (rev 41351)
+++ CMF/trunk/CMFCore/fiveactionstool.py 2006-01-18 10:11:09 UTC (rev 41352)
@@ -19,6 +19,9 @@
from Globals import InitializeClass
from Globals import DTMLFile
from OFS.SimpleItem import SimpleItem
+from zope.app import zapi
+from zope.app.publisher.interfaces.browser import IBrowserMenu
+from zope.app.publisher.browser.menu import getMenu
from ActionInformation import ActionInformation
from ActionProviderBase import ActionProviderBase
@@ -27,23 +30,7 @@
from utils import UniqueObject
from utils import _dtmldir
-try: # BBB (actually, FFF ;)
- from zope.app.publisher.browser.globalbrowsermenuservice import \
- globalBrowserMenuService
-except ImportError: # Zope3 > 3.0 loses services
- from zope.app import zapi
- from zope.app.publisher.interfaces.browser import IBrowserMenu
- from zope.app.publisher.browser.menu import getMenu
- def _listMenuIds():
- return zapi.getUtilitiesFor(IBrowserMenu)
-else:
-
- from browser.globalbrowsermenuservice import getMenu
- def _listMenuIds():
- return globalBrowserMenuService._registry.keys()
-
-
class FiveActionsTool(UniqueObject, SimpleItem, ActionProviderBase):
"""Five actions tool.
@@ -86,7 +73,7 @@
actions = []
- for menu_id in _listMenuIds():
+ for menu_id in zapi.getUtilitiesFor(IBrowserMenu):
for entry in getMenu(menu_id, object, self.REQUEST):
# The action needs a unique name, so we'll build one
# from the object_id and the action url. That is sure
Modified: CMF/trunk/CMFCore/tests/base/testcase.py
===================================================================
--- CMF/trunk/CMFCore/tests/base/testcase.py 2006-01-18 09:13:11 UTC (rev 41351)
+++ CMF/trunk/CMFCore/tests/base/testcase.py 2006-01-18 10:11:09 UTC (rev 41352)
@@ -11,24 +11,19 @@
from stat import S_IREAD, S_IWRITE
from tempfile import mktemp
+import transaction
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from Testing.makerequest import makerequest
-import transaction
+from zope.app.testing.placelesssetup import PlacelessSetup
+from zope.app.testing.placelesssetup import setUp as placelessSetUp
+from zope.app.testing.placelesssetup import tearDown as placelessTearDown
from dummy import DummyFolder
from security import AnonymousUser
from security import PermissiveSecurityPolicy
-try:
- from zope.app.testing.placelesssetup import PlacelessSetup
- from zope.app.testing.placelesssetup import setUp as placelessSetUp
- from zope.app.testing.placelesssetup import tearDown as placelessTearDown
-except ImportError: # BBB, Zope3 < 3.1
- from zope.app.tests.placelesssetup import PlacelessSetup
- from zope.app.tests.placelesssetup import setUp as placelessSetUp
- from zope.app.tests.placelesssetup import tearDown as placelessTearDown
_TRAVERSE_ZCML = """
<configure
Modified: CMF/trunk/CMFDefault/tests/test_SyndicationTool.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_SyndicationTool.py 2006-01-18 09:13:11 UTC (rev 41351)
+++ CMF/trunk/CMFDefault/tests/test_SyndicationTool.py 2006-01-18 10:11:09 UTC (rev 41352)
@@ -160,14 +160,6 @@
# http://www.zope.org/Collectors/CMF/369
# Make sure we use a suitable base class call when determining
# syndicatable content
- try:
- # This test only makes sense if CMFBTreeFolder is installed,
- # which depends on the BTreeFolder2 product, which might not
- # always be available.
- from Products.CMFCore import CMFBTreeFolder
- except ImportError:
- return
-
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder
from Products.CMFCore.TypesTool import TypesTool
More information about the CMF-checkins
mailing list