[Zope3-checkins] CVS: Zope3/src/zope/app/menu - __init__.py:1.4 tests.py:1.6

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 23 17:09:41 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/menu
In directory cvs.zope.org:/tmp/cvs-serv23661/src/zope/app/menu

Modified Files:
	__init__.py tests.py 
Log Message:
Rip out usage everwhere.


=== Zope3/src/zope/app/menu/__init__.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/menu/__init__.py:1.3	Sat Mar 13 18:55:10 2004
+++ Zope3/src/zope/app/menu/__init__.py	Tue Mar 23 17:09:40 2004
@@ -73,9 +73,6 @@
     description = u''
 
     # See zope.app.publisher.interfaces.browser.IBrowserMenu
-    usage = u''
-
-    # See zope.app.publisher.interfaces.browser.IBrowserMenu
     inherit = True
 
     def __init__(self):
@@ -189,9 +186,4 @@
         """See zope.app.publisher.interfaces.browser.IBrowserMenuService"""
         return super(LocalBrowserMenuService,
                      self).getFirstMenuItem(menu_id, object, request)
-
-
-    def getMenuUsage(self, menu_id):
-        """See zope.app.publisher.interfaces.browser.IBrowserMenuService"""
-        return self.getInheritedMenu(menu_id, True).usage
 


=== Zope3/src/zope/app/menu/tests.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/menu/tests.py:1.5	Sat Mar 13 18:55:10 2004
+++ Zope3/src/zope/app/menu/tests.py	Tue Mar 23 17:09:40 2004
@@ -57,12 +57,11 @@
         return self.f
 
 
-def addMenu(servicemanager, menu_id, title, inherit, usage=''):
+def addMenu(servicemanager, menu_id, title, inherit):
     """Add a menu to the service manager's default package."""
     menu = LocalBrowserMenu()
     menu.title = title
     menu.inherit = inherit
-    menu.usage = usage
 
     default = zapi.traverse(servicemanager, 'default')
     default[menu_id] = menu
@@ -98,13 +97,10 @@
         
         # Create Placeless Components
         ps = zapi.getService(None, zapi.servicenames.Presentation)
-        ps.defineUsage('usage')
-        ps.defineUsage('usage 2')
-        ps.defineUsage('usage 3')
         ms = zapi.getService(None, BrowserMenu)
-        ms.menu('test_id', 'test menu', usage='usage')
-        ms.menu('test_id2', 'test menu 2', usage='usage 2')
-        ms.menu('test_id3', 'test menu 3', usage='usage 3')
+        ms.menu('test_id', 'test menu')
+        ms.menu('test_id2', 'test menu 2')
+        ms.menu('test_id3', 'test menu 3')
         ms.menuItem('test_id', Interface, 'a0', 't0', 'd0')
         ms.menuItem('test_id',   I1, 'a1', 't1', 'd1')
         ms.menuItem('test_id',  I11, 'a2', 't2', 'd2')
@@ -121,11 +117,11 @@
         setup.addService(mgr, Utilities, LocalUtilityService())
         self.root_ms = setup.addService(mgr, BrowserMenu,
                                         LocalBrowserMenuService())
-        menu = addMenu(mgr, 'test_id', 'test menu r', True, 'usage r')
+        menu = addMenu(mgr, 'test_id', 'test menu r', True)
         addMenuItem(menu, I1,  'ar1', 'tr1')
         addMenuItem(menu, I11, 'ar2', 'tr2')
         addMenuItem(menu, I12, 'ar3', 'tr3')
-        menu = addMenu(mgr, 'test_id2', 'test menu 2 r', False, 'usage 2 r')
+        menu = addMenu(mgr, 'test_id2', 'test menu 2 r', False)
         addMenuItem(menu, I1,  'ar4', 'tr4')
         addMenuItem(menu, I11, 'ar5', 'tr5')
         addMenuItem(menu, I12, 'ar6', 'tr6')
@@ -136,11 +132,11 @@
         setup.addService(mgr, Utilities, LocalUtilityService())
         self.folder_ms = setup.addService(mgr, BrowserMenu,
                                           LocalBrowserMenuService())
-        menu = addMenu(mgr, 'test_id', 'test menu f', True, 'usage f')
+        menu = addMenu(mgr, 'test_id', 'test menu f', True)
         addMenuItem(menu, I1,  'af1', 'tf1')
         addMenuItem(menu, I11, 'af2', 'tf2')
         addMenuItem(menu, I12, 'af3', 'tf3')
-        menu = addMenu(mgr, 'test_id3', 'test menu 3 f', True, 'usage 3 f')
+        menu = addMenu(mgr, 'test_id3', 'test menu 3 f', True)
         addMenuItem(menu, I1,  'af7', 'tf7')
         addMenuItem(menu, I11, 'af8', 'tf8')
         addMenuItem(menu, I12, 'af9', 'tf9')
@@ -308,22 +304,7 @@
 
         self.assertRaises(KeyError, self.folder_ms.getFirstMenuItem,
                           'test_id', None, TestRequest())
-
-
-    def test_getMenuUsage(self):
-        for ms, menu_id, usage in [
-            (self.root_ms, 'test_id', 'usage r'),
-            (self.root_ms, 'test_id2', 'usage 2 r'),
-            (self.root_ms, 'test_id3', 'usage 3'),
-            (self.folder_ms, 'test_id', 'usage f'),
-            (self.folder_ms, 'test_id2', 'usage 2 r'),
-            (self.folder_ms, 'test_id3', 'usage 3 f'),
-            ]:
-            self.assertEqual(ms.getMenuUsage(menu_id), usage)
-
-        self.assertRaises(KeyError, self.root_ms.getMenuUsage, 'test_id4')
-        self.assertRaises(KeyError, self.folder_ms.getMenuUsage, 'test_id4')
-        
+       
         
 
 def test_suite():




More information about the Zope3-Checkins mailing list