[Zope3-checkins] CVS: Zope3/src/zope/app/utility/browser -
__init__.py:1.7
Stephan Richter
srichter at cosmos.phy.tufts.edu
Sat Apr 24 19:17:45 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/utility/browser
In directory cvs.zope.org:/tmp/cvs-serv28964/src/zope/app/utility/browser
Modified Files:
__init__.py
Log Message:
Vocabulary that provides terms for utilities providing a specified interface.
=== Zope3/src/zope/app/utility/browser/__init__.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/utility/browser/__init__.py:1.6 Sat Apr 17 10:33:47 2004
+++ Zope3/src/zope/app/utility/browser/__init__.py Sat Apr 24 19:17:44 2004
@@ -15,7 +15,6 @@
$Id$
"""
-from zope.app.component.browser.interfacewidget import InterfaceWidget
from zope.app.registration.browser import AddComponentRegistration
from zope.app.form import CustomWidgetFactory
from zope.app.registration.interfaces import ActiveStatus
@@ -27,22 +26,6 @@
from zope.security.proxy import trustedRemoveSecurityProxy
from zope.app.introspector import interfaceToName
-class UtilityInterfaceWidget(InterfaceWidget):
- """Custom widget to select an interface from the component's interfaces.
- """
-
- def __call__(self):
- field = self.context
- component = field.context
- result = ['\n<select name="%s">' % self.name]
- for interface in providedBy(component).flattened():
- interface = trustedRemoveSecurityProxy(interface)
- result.append(' <option value="%s.%s">%s</option>' %
- (interface.__module__, interface.getName(),
- interface.getName()))
- result.append('</select>')
- return '\n'.join(result)
-
class AddRegistration(AddComponentRegistration):
"""View for adding a utility registration.
@@ -53,8 +36,6 @@
This is a view on a local utility, configured by an <addform>
directive.
"""
- interface_widget = CustomWidgetFactory(UtilityInterfaceWidget)
-
def add(self, registration):
reg = super(AddRegistration, self).add(registration)
reg.status = ActiveStatus
More information about the Zope3-Checkins
mailing list