[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - TabsDirective.py:1.1.2.2 ZMIViewService.py:1.1.2.2
Kapil
k_vertigo@yahoo.com
Thu, 31 Jan 2002 18:47:15 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI
In directory cvs.zope.org:/tmp/cvs-serv6195
Modified Files:
Tag: Zope-3x-branch
TabsDirective.py ZMIViewService.py
Log Message:
(sprint) added zope configuration directives for zmi tabs
=== Zope3/lib/python/Zope/App/ZMI/TabsDirective.py 1.1.2.1 => 1.1.2.2 ===
import INonEmptyDirective
+from Zope.Configuration.Action import Action
+from Zope.Configuration.name import resolve
+
+#from ComponentArchitecture import getService
+from ZMIViewService import ZMIViews
+
class TabsDirective:
__implements__ = INonEmptyDirective
def __init__(self, for_):
- pass
- #stub
+ self._for_ = resolve(for_)
def tab(self, label, action):
- return ()
- #stub
+ return [
+ Action(
+ discriminator =('tab', self._for_, label),
+ callable = ZMIViews.registerView,
+ args = (self._for_, label, action)
+ )
+ ]
def __call__(self):
return ()
=== Zope3/lib/python/Zope/App/ZMI/ZMIViewService.py 1.1.2.1 => 1.1.2.2 ===
res.extend(self._reg.get(interface, ()) )
return res
-
-
+
+ZMIViews = ZMIViewService()
+