[Checkins] SVN: z3c.menu.ready2go/trunk/ - Replaced ``zope.app.component`` by ``zope.site``.
Michael Howitz
mh at gocept.com
Sat Feb 7 10:21:01 EST 2009
Log message for revision 96211:
- Replaced ``zope.app.component`` by ``zope.site``.
- Replaced ``zope.app.container`` by ``zope.container``.
- ``zope.app.pagetemplate`` is only a test dependency.
Changed:
U z3c.menu.ready2go/trunk/CHANGES.txt
U z3c.menu.ready2go/trunk/setup.py
U z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/README.txt
U z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/item.py
U z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/testing.py
U z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/tests.py
-=-
Modified: z3c.menu.ready2go/trunk/CHANGES.txt
===================================================================
--- z3c.menu.ready2go/trunk/CHANGES.txt 2009-02-07 15:06:02 UTC (rev 96210)
+++ z3c.menu.ready2go/trunk/CHANGES.txt 2009-02-07 15:21:01 UTC (rev 96211)
@@ -2,12 +2,16 @@
CHANGES
=======
-0.5.2 (unreleased)
+0.6.0 (unreleased)
------------------
--
+- Replaced ``zope.app.component`` by ``zope.site``.
+- Replaced ``zope.app.container`` by ``zope.container``.
+- ``zope.app.pagetemplate`` is only a test dependency.
+
+
0.5.1 (2009-01-04)
------------------
Modified: z3c.menu.ready2go/trunk/setup.py
===================================================================
--- z3c.menu.ready2go/trunk/setup.py 2009-02-07 15:06:02 UTC (rev 96210)
+++ z3c.menu.ready2go/trunk/setup.py 2009-02-07 15:21:01 UTC (rev 96211)
@@ -53,7 +53,7 @@
extras_require = dict(
test = [
'z3c.testing',
- 'zope.app.container',
+ 'zope.container',
'zope.app.pagetemplate',
'zope.app.testing',
'zope.component',
@@ -64,8 +64,6 @@
'setuptools',
'z3c.i18n',
'z3c.template',
- 'zope.app.component',
- 'zope.app.pagetemplate',
'zope.app.publisher',
'zope.configuration',
'zope.interface',
@@ -73,6 +71,7 @@
'zope.publisher',
'zope.schema',
'zope.security',
+ 'zope.site',
'zope.traversing',
'zope.viewlet',
],
Modified: z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/README.txt
===================================================================
--- z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/README.txt 2009-02-07 15:06:02 UTC (rev 96210)
+++ z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/README.txt 2009-02-07 15:21:01 UTC (rev 96211)
@@ -2,7 +2,7 @@
Ready 2 go Menu
===============
-The z3c.menu.ready2go package provides a menu implementation which allows you
+The z3c.menu.ready2go package provides a menu implementation which allows you
to implement menus based on content providers and viewlets.
First let's setup our defualt menu item template:
@@ -75,12 +75,11 @@
Now we have to define a site and a context:
>>> import zope.interface
- >>> from zope.app.container import contained
- >>> from zope.app.container import btree
- >>> from zope.app.container.interfaces import IContained
+ >>> from zope.container import contained, btree
+ >>> from zope.container.interfaces import IContained
>>> from zope.location.interfaces import IPossibleSite
- >>> from zope.app.component.site import SiteManagerContainer
- >>> from zope.app.component.site import LocalSiteManager
+ >>> from zope.site.site import SiteManagerContainer
+ >>> from zope.site.site import LocalSiteManager
>>> class Site(btree.BTreeContainer, SiteManagerContainer):
... zope.interface.implements(IPossibleSite)
@@ -94,11 +93,11 @@
>>> root['site'] = Site()
>>> site = root['site']
-Now we have to set the site object as site. This is normaly done by the
+Now we have to set the site object as site. This is normaly done by the
traverser but we do this here with the hooks helper because we do not really
traaverse to the site within the publisher/traverser:
- >>> from zope.app.component import hooks
+ >>> from zope.site import hooks
>>> hooks.setSite(site)
>>> site['content'] = Content()
@@ -110,9 +109,9 @@
And we need a view which knows about it's parent:
>>> class View(contained.Contained):
- ...
+ ...
... zope.interface.implements(IBrowserView)
- ...
+ ...
... def __init__(self, context, request):
... self.__parent__ = context
... self.context = context
@@ -170,7 +169,7 @@
... IBrowserView, IGlobalMenu),
... IViewlet, name='My Global')
-Now let's update the menu manager and see that this manager now contains
+Now let's update the menu manager and see that this manager now contains
the menu item:
>>> globalMenu.update()
@@ -253,7 +252,7 @@
... IBrowserView, IContextMenu),
... IViewlet, name='My Context')
-Now let's render the context menu again. You can see that we ve got a menu
+Now let's render the context menu again. You can see that we ve got a menu
item. Another important point here is, that the url of such ContextMemuItem
implementations point to the context of the view:
@@ -278,7 +277,7 @@
</li>
Also, let's check that menu item is marked selected even if we provided a viewName in
-the ``@@context.html`` form:
+the ``@@context.html`` form:
>>> MyContextMenuItem.viewName = '@@context.html'
>>> contextMenu.update()
@@ -321,7 +320,7 @@
AddMenu
-------
-The add menu can be used for offering links to any kind of add forms per
+The add menu can be used for offering links to any kind of add forms per
context. This allows us to offer independent add form links doesn't matter which
form framework is used. Let's now define such a simple AddMenuItem pointing
to a add form url. Not; the add form and it's url do not exist in thsi test.
@@ -362,12 +361,12 @@
The global and the site menu items are grouped menu items. This means such menu
items should get rendered as selected if a context menu item is selected. This
-reflects the menu hierarchie. Let's show how we can solve this not so simple
-problem. We offer a ISelectedChecker adapter which can decide if a menu get
-rendered as selected or not. This is very usefull because normaly a menu get
-registered and later we add views and can not change the menu item
-implementation. Let's see how such an adapter can handle an existing menu,
-context and view setup and change the selected rendering. We register a
+reflects the menu hierarchie. Let's show how we can solve this not so simple
+problem. We offer a ISelectedChecker adapter which can decide if a menu get
+rendered as selected or not. This is very usefull because normaly a menu get
+registered and later we add views and can not change the menu item
+implementation. Let's see how such an adapter can handle an existing menu,
+context and view setup and change the selected rendering. We register a
selected checker for our site menu item:
>>> zope.component.provideAdapter(checker.TrueSelectedChecker,
@@ -383,7 +382,7 @@
<a href="http://127.0.0.1/site/site.html"><span>My Site</span></a>
</li>
-This reflects that the site menu is a group menu which the context menu item
+This reflects that the site menu is a group menu which the context menu item
of the content object is selected too.
>>> contextMenu.update()
@@ -421,10 +420,10 @@
----------------
We have some special use case because of Zope's internals. One important part
-is that our menu heavy depend on context and it's __parent__ chain to the
+is that our menu heavy depend on context and it's __parent__ chain to the
zope application root. This is not allways supported by Zopes default setup.
One part is the bad integrated application control part which fakes a root
-object which doesn't know about the real childs of the real root from the
+object which doesn't know about the real childs of the real root from the
ZODB e.g. application root. Now we will show you that our menu by default
render no items if we get such a fake root which messes up our menu structure.
Modified: z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/item.py
===================================================================
--- z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/item.py 2009-02-07 15:06:02 UTC (rev 96210)
+++ z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/item.py 2009-02-07 15:21:01 UTC (rev 96211)
@@ -22,7 +22,7 @@
from zope.traversing.browser import absoluteURL
from zope.viewlet import viewlet
-from zope.app.component import hooks
+from zope.site import hooks
from z3c.template.template import getPageTemplate
from z3c.menu.ready2go import interfaces
@@ -66,9 +66,9 @@
def setupFilter(self):
"""Catch location error and set approved attributes.
-
- Note, this get called before update because the filter method in menu
- manager needs to know that before the menu items update method get
+
+ Note, this get called before update because the filter method in menu
+ manager needs to know that before the menu items update method get
called.
"""
try:
@@ -86,7 +86,7 @@
@property
def css(self):
- """Return cssActive, cssInActive or None.
+ """Return cssActive, cssInActive or None.
None will force not rendering a HTML attribute in the element tag.
"""
Modified: z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/testing.py
===================================================================
--- z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/testing.py 2009-02-07 15:06:02 UTC (rev 96210)
+++ z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/testing.py 2009-02-07 15:21:01 UTC (rev 96211)
@@ -20,7 +20,7 @@
from zope.publisher.interfaces.browser import IBrowserView
from zope.app.testing import setup
from zope.app.testing import ztapi
-from zope.app.container import contained
+from zope.container import contained
from z3c.menu.ready2go import interfaces
from z3c.menu.ready2go import item
Modified: z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/tests.py
===================================================================
--- z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/tests.py 2009-02-07 15:06:02 UTC (rev 96210)
+++ z3c.menu.ready2go/trunk/src/z3c/menu/ready2go/tests.py 2009-02-07 15:21:01 UTC (rev 96211)
@@ -22,7 +22,7 @@
from zope.testing.doctestunit import DocFileSuite
from zope.traversing.browser.interfaces import IAbsoluteURL
from zope.traversing.interfaces import IPhysicallyLocatable
-from zope.app.component import hooks
+from zope.site import hooks
from zope.app.testing import setup
import z3c.testing
More information about the Checkins
mailing list