[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component - interfacewidget.py:1.37

Sidnei da Silva sidnei at x3ng.com.br
Mon Aug 11 13:56:21 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/component
In directory cvs.zope.org:/tmp/cvs-serv16063

Modified Files:
	interfacewidget.py 
Log Message:
Adjusted imports

=== Zope3/src/zope/app/browser/component/interfacewidget.py 1.36 => 1.37 ===
--- Zope3/src/zope/app/browser/component/interfacewidget.py:1.36	Fri Aug  8 19:16:39 2003
+++ Zope3/src/zope/app/browser/component/interfacewidget.py	Mon Aug 11 12:56:16 2003
@@ -29,7 +29,7 @@
 from zope.app.browser.form.widget import BrowserWidget
 from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.app.traversing import getPath
-
+from zope.app.introspector import nameToInterface, interfaceToName
 
 class InterfaceWidget(BrowserWidget, BrowserView):
     implements(IBrowserWidget)
@@ -371,20 +371,3 @@
     HTML = search_field + select_field
     return HTML
 
-def nameToInterface(context, name):
-    if name == 'None':
-        return None
-    service = getService(context, Interfaces)
-    return service.getInterface(name)
-
-def interfaceToName(context, interface):
-    if interface is None:
-        return 'None'
-    service = getService(context, Interfaces)
-    items = service.items()
-    ids = [id for id, iface in items
-           if iface == interface]
-    if not ids:
-        raise ComponentLookupError, interface
-    assert len(ids) == 1, "Ambiguous interface names: %s" % ids
-    return ids[0]




More information about the Zope3-Checkins mailing list