[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/ - remove dependency on zope.app.zapi

Fred L. Drake, Jr. fdrake at gmail.com
Sat Mar 24 19:51:09 EDT 2007


Log message for revision 73522:
  - remove dependency on zope.app.zapi
  - remove dependency on zope.app.i18n
  

Changed:
  U   Zope3/trunk/src/zope/app/form/browser/add.py
  U   Zope3/trunk/src/zope/app/form/browser/boolwidgets.py
  U   Zope3/trunk/src/zope/app/form/browser/editview.py
  U   Zope3/trunk/src/zope/app/form/browser/formview.py
  A   Zope3/trunk/src/zope/app/form/browser/i18n.py
  U   Zope3/trunk/src/zope/app/form/browser/itemswidgets.py
  U   Zope3/trunk/src/zope/app/form/browser/metaconfigure.py
  U   Zope3/trunk/src/zope/app/form/browser/objectwidget.py
  U   Zope3/trunk/src/zope/app/form/browser/sequencewidget.py
  U   Zope3/trunk/src/zope/app/form/browser/source.py
  U   Zope3/trunk/src/zope/app/form/browser/tests/test_registrations.py
  U   Zope3/trunk/src/zope/app/form/browser/tests/test_widgetdirective.py
  U   Zope3/trunk/src/zope/app/form/browser/textwidgets.py
  U   Zope3/trunk/src/zope/app/form/utility.py

-=-
Modified: Zope3/trunk/src/zope/app/form/browser/add.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/add.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/add.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -30,8 +30,8 @@
 from zope.lifecycleevent import Attributes
 
 from zope.app.form.utility import setUpWidgets, getWidgetsData
-from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.form.interfaces import IInputWidget, WidgetsError
+from zope.app.form.browser.i18n import _
 from zope.app.pagetemplate.simpleviewclass import SimpleViewClass
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from editview import EditView

Modified: Zope3/trunk/src/zope/app/form/browser/boolwidgets.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/boolwidgets.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/boolwidgets.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -22,11 +22,12 @@
 
 from zope.app.form.browser.widget import SimpleInputWidget, renderElement
 from zope.app.form.browser.widget import DisplayWidget
+from zope.app.form.browser.i18n import _
 from zope.app.form.browser.itemswidgets import RadioWidget
 from zope.app.form.browser.itemswidgets import SelectWidget, DropdownWidget
 from zope.app.form.interfaces import IInputWidget
-from zope.app.i18n import ZopeMessageFactory as _
 
+
 class CheckBoxWidget(SimpleInputWidget):
     """A checkbox widget used to display Bool fields.
     

Modified: Zope3/trunk/src/zope/app/form/browser/editview.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/editview.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/editview.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -30,11 +30,11 @@
 from zope.lifecycleevent import ObjectModifiedEvent
 from zope.lifecycleevent import Attributes
 
-from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from zope.app.pagetemplate.simpleviewclass import SimpleViewClass
 from zope.app.form.interfaces import WidgetsError
 from zope.app.form.utility import setUpEditWidgets, applyWidgetsChanges
+from zope.app.form.browser.i18n import _
 from zope.app.form.browser.submit import Update
 
 class EditView(BrowserView):

Modified: Zope3/trunk/src/zope/app/form/browser/formview.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/formview.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/formview.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -23,8 +23,8 @@
 
 from zope.app.form.utility import setUpWidgets, applyWidgetsChanges
 from zope.app.form.browser.editview import EditView
+from zope.app.form.browser.i18n import _
 from zope.app.form.browser.submit import Update
-from zope.app.i18n import ZopeMessageFactory as _
 
 
 class Data(dict):

Added: Zope3/trunk/src/zope/app/form/browser/i18n.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/i18n.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/i18n.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -0,0 +1,9 @@
+"""\
+I18N support for zope.app.form.browser.
+
+"""
+__docformat__ = "reStructuredText"
+
+import zope.i18nmessageid
+
+_ = zope.i18nmessageid.MessageFactory("zope")


Property changes on: Zope3/trunk/src/zope/app/form/browser/i18n.py
___________________________________________________________________
Name: svn:mime-type
   + text/x-python
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/form/browser/itemswidgets.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/itemswidgets.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/itemswidgets.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -19,52 +19,51 @@
 import sets
 from xml.sax.saxutils import escape
 
+from zope import component
 from zope.interface import implements
 from zope.i18n import translate
 from zope.schema.interfaces import ValidationError, InvalidValue
 from zope.schema.interfaces import ConstraintNotSatisfied, ITitledTokenizedTerm
 
-from zope.app import zapi
 from zope.app.form.browser.widget import SimpleInputWidget, renderElement
 from zope.app.form.interfaces import IInputWidget, IDisplayWidget
 from zope.app.form.interfaces import ConversionError
+from zope.app.form.browser.i18n import _
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 
-from zope.app.i18n import ZopeMessageFactory as _
 
-
 # For choices, we want to make the widget a view of the field and vocabulary.
 
 def ChoiceDisplayWidget(field, request):
-    return zapi.getMultiAdapter((field, field.vocabulary, request),
-                                IDisplayWidget)
+    return component.getMultiAdapter((field, field.vocabulary, request),
+                                     IDisplayWidget)
 
 def ChoiceInputWidget(field, request):
-    return zapi.getMultiAdapter((field, field.vocabulary, request),
-                                IInputWidget)
+    return component.getMultiAdapter((field, field.vocabulary, request),
+                                     IInputWidget)
 
 # for collections, we want to make the widget a view of the field and the
 # value_type.  If the value_type is None we may fall over.  We may
 # not be able to do any better than that.
 
 def CollectionDisplayWidget(field, request):
-    return zapi.getMultiAdapter((field, field.value_type, request),
-                                IDisplayWidget)
+    return component.getMultiAdapter((field, field.value_type, request),
+                                     IDisplayWidget)
 
 def CollectionInputWidget(field, request):
-    return zapi.getMultiAdapter((field, field.value_type, request),
-                                IInputWidget)
+    return component.getMultiAdapter((field, field.value_type, request),
+                                     IInputWidget)
 
 # for collections of choices, we want to make the widget a view of the field,
 # the value type, and the vocabulary.
 
 def ChoiceCollectionDisplayWidget(field, value_type, request):
-    return zapi.getMultiAdapter((field, value_type.vocabulary, request),
-                                IDisplayWidget)
+    return component.getMultiAdapter((field, value_type.vocabulary, request),
+                                     IDisplayWidget)
 
 def ChoiceCollectionInputWidget(field, value_type, request):
-    return zapi.getMultiAdapter((field, value_type.vocabulary, request),
-                                IInputWidget)
+    return component.getMultiAdapter((field, value_type.vocabulary, request),
+                                     IInputWidget)
 
 class TranslationHook(object):
     """A mixin class that provides the translation capabilities."""

Modified: Zope3/trunk/src/zope/app/form/browser/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/metaconfigure.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/metaconfigure.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -30,9 +30,9 @@
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.publisher.interfaces.browser import IDefaultBrowserLayer
 from zope.app.publisher.browser.menumeta import menuItemDirective
-from zope.app.i18n import ZopeMessageFactory as _
 
 from zope.app.form import CustomWidgetFactory
+from zope.app.form.browser.i18n import _
 from zope.app.form.interfaces import IInputWidget, IDisplayWidget
 from add import AddView, AddViewFactory
 from editview import EditView, EditViewFactory

Modified: Zope3/trunk/src/zope/app/form/browser/objectwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/objectwidget.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/objectwidget.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -17,10 +17,10 @@
 """
 __docformat__ = 'restructuredtext'
 
+from zope import component
 from zope.interface import implements
 from zope.schema import getFieldNamesInOrder
 
-from zope.app import zapi
 from zope.app.form.interfaces import IInputWidget
 from zope.app.form import InputWidget
 from zope.app.form.browser.widget import BrowserWidget
@@ -113,8 +113,9 @@
             keys = self._error.keys(); keys.sort()
             for key in keys:
                 errormessages.append(str(key) + ': ')
-                errormessages.append( zapi.getMultiAdapter((self._error[key], self.request),
-                                        IWidgetInputErrorView).snippet())
+                errormessages.append(component.getMultiAdapter(
+                    (self._error[key], self.request),
+                    IWidgetInputErrorView).snippet())
                 errormessages.append(str(key) + ', ')
             return ''.join(errormessages[0:-1])
         return ""

Modified: Zope3/trunk/src/zope/app/form/browser/sequencewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/sequencewidget.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/sequencewidget.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -17,18 +17,18 @@
 """
 __docformat__ = 'restructuredtext'
 
+from zope import component
 from zope.interface import implements
 from zope.i18n import translate
 from zope.schema.interfaces import ValidationError
 
-from zope.app import zapi
 from zope.app.form.interfaces import IDisplayWidget, IInputWidget
 from zope.app.form.interfaces import WidgetInputError, MissingInputError
 from zope.app.form import InputWidget
+from zope.app.form.browser.i18n import _
 from zope.app.form.browser.widget import BrowserWidget
 from zope.app.form.browser.widget import DisplayWidget, renderElement
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from zope.app.i18n import ZopeMessageFactory as _
 
 
 class SequenceWidget(BrowserWidget, InputWidget):
@@ -99,8 +99,8 @@
             if self.subwidget is not None:
                 widget = self.subwidget(field, self.request)
             else:
-                widget = zapi.getMultiAdapter((field, self.request),
-                                              IInputWidget)
+                widget = component.getMultiAdapter(
+                    (field, self.request), IInputWidget)
             widget.setPrefix('%s.%d.' % (self.name, i))
             if not self.preserve_widgets:
                 return widget
@@ -304,7 +304,7 @@
         if self.subwidget is not None:
             widget = self.subwidget(field, self.request)
         else:
-            widget = zapi.getMultiAdapter(
+            widget = component.getMultiAdapter(
                 (field, self.request), IDisplayWidget)
         widget.setPrefix('%s.%d.' % (self.name, i))
         return widget

Modified: Zope3/trunk/src/zope/app/form/browser/source.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/source.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/source.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -20,17 +20,17 @@
 
 import xml.sax.saxutils
 
-from zope.component import adapts
+from zope.component import adapts, getMultiAdapter
 from zope.interface import implements
 import zope.schema.interfaces
 from zope.schema.interfaces import \
     ISourceQueriables, ValidationError, IVocabularyTokenized, IIterableSource
-from zope.app import zapi
+
 import zope.app.form.interfaces
 import zope.app.form.browser.widget
 import zope.app.form.browser.interfaces
-from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.form.interfaces import WidgetInputError, MissingInputError
+from zope.app.form.browser.i18n import _
 from zope.app.form.browser.interfaces import ITerms, IWidgetInputErrorView
 from zope.app.form.browser import \
     SelectWidget, RadioWidget, MultiSelectWidget, OrderedMultiSelectWidget, \
@@ -65,7 +65,7 @@
             value = self._translate(_("SourceDisplayWidget-missing",
                                       default="Nothing"))
         else:
-            terms = zapi.getMultiAdapter(
+            terms = getMultiAdapter(
                 (self.source, self.request),
                 zope.app.form.browser.interfaces.ITerms,
                 )
@@ -95,7 +95,7 @@
         else:
             seq = self.context.default
 
-        terms = zapi.getMultiAdapter(
+        terms = getMultiAdapter(
             (self.source, self.request),
             zope.app.form.browser.interfaces.ITerms,
             )
@@ -123,7 +123,7 @@
     def __init__(self, field, source, request):
         super(SourceInputWidget, self).__init__(field, request)
         self.source = source
-        self.terms = zapi.getMultiAdapter(
+        self.terms = getMultiAdapter(
             (source, self.request),
             zope.app.form.browser.interfaces.ITerms,
             )
@@ -140,7 +140,7 @@
                           for (i, s) in queriables.getQueriables()]
 
         return [
-            (name, zapi.getMultiAdapter(
+            (name, getMultiAdapter(
                     (source, self.request),
                     zope.app.form.browser.interfaces.ISourceQueryView,
                     )
@@ -189,8 +189,8 @@
     def error(self):
         if self._error:
             # TODO This code path is untested.
-            return zapi.getMultiAdapter((self._error, self.request),
-                                        IWidgetInputErrorView).snippet()
+            return getMultiAdapter((self._error, self.request),
+                                   IWidgetInputErrorView).snippet()
         return ""
 
     def __call__(self):
@@ -525,7 +525,7 @@
 
     def __init__(self, source, request):
         self.source = source
-        self.terms = zapi.getMultiAdapter(
+        self.terms = getMultiAdapter(
             (source, request), zope.app.form.browser.interfaces.ITerms)
 
     def getTerm(self, value):

Modified: Zope3/trunk/src/zope/app/form/browser/tests/test_registrations.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/tests/test_registrations.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/tests/test_registrations.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -17,12 +17,12 @@
 """
 import unittest
 
+from zope.component import getMultiAdapter
 from zope.configuration import xmlconfig
 from zope.interface import implements
 from zope.publisher.browser import TestRequest
 from zope.testing.doctestunit import DocTestSuite
 
-from zope.app import zapi
 from zope.app.testing import setup
 # import all widgets (in this case, importing * is ok, since we
 # absolutely know what we're importing)
@@ -68,119 +68,119 @@
     IField, IDisplayWidget -> DisplayWidget
         
         >>> field = fields.Field()
-        >>> widget = zapi.getMultiAdapter((field, request), IDisplayWidget)
+        >>> widget = getMultiAdapter((field, request), IDisplayWidget)
         >>> isinstance(widget, DisplayWidget)
         True
         
     ITextLine, IInputWidget -> TextWidget 
         
         >>> field = fields.TextLine()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, TextWidget)
         True
         
     IText, IInputWidget -> TextAreaWidget
     
         >>> field = fields.Text()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, TextAreaWidget)
         True
         
     ISourceText, IInputWidget -> TextAreaWidget
     
         >>> field = fields.SourceText()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, TextAreaWidget)
         True
 
     IBytesLine, IInputWidget -> BytesWidget
     
         >>> field = fields.BytesLine()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, BytesWidget)
         True
 
     IBytes, IInputWidget -> FileWidget
     
         >>> field = fields.Bytes()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, FileWidget)
         True
         		
     IASCIILine, IInputWidget -> ASCIIWidget
     
         >>> field = fields.ASCIILine()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, ASCIIWidget)
         True
         
     IASCII, IInputWidget -> ASCIIAreaWidget
     
         >>> field = fields.ASCII()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, ASCIIAreaWidget)
         True
         
     IInt, IInputWidget -> IntWidget
     
         >>> field = fields.Int()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, IntWidget)
         True
         
     IFloat, IInputWidget -> FloatWidget
     
         >>> field = fields.Float()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, FloatWidget)
         True
 
     IDecimal, IInputWidget -> DecimalWidget
     
         >>> field = fields.Decimal()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, DecimalWidget)
         True
         
     IDatetime, IInputWidget -> DatetimeWidget
     
         >>> field = fields.Datetime()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, DatetimeWidget)
         True
         
     IDate, IInputWidget -> DateWidget
     
         >>> field = fields.Date()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, DateWidget)
         True
         
     IBool, IInputWidget -> CheckBoxWidget
     
         >>> field = fields.Bool()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, CheckBoxWidget)
         True
         
     ITuple, IInputWidget -> TupleSequenceWidget
     
         >>> field = fields.Tuple(value_type=fields.Int())
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, TupleSequenceWidget)
         True
 
     IList, IInputWidget -> ListSequenceWidget
     
         >>> field = fields.List(value_type=fields.Int())
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, ListSequenceWidget)
         True
 
     IPassword, IInputWidget -> PasswordWidget
     
         >>> field = fields.Password()
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, PasswordWidget)
         True
 
@@ -188,7 +188,7 @@
     
         >>> field = fields.Choice(vocabulary=vocab)
         >>> field = field.bind(sample)
-        >>> widget = zapi.getMultiAdapter((field, request), IDisplayWidget)
+        >>> widget = getMultiAdapter((field, request), IDisplayWidget)
         >>> isinstance(widget, ItemDisplayWidget)
         True
                 
@@ -196,7 +196,7 @@
     
         >>> field = fields.Choice(vocabulary=vocab)
         >>> field = field.bind(sample)
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, DropdownWidget)
         True
 
@@ -204,7 +204,7 @@
     
         >>> field = fields.List(value_type=fields.Choice(vocabulary=vocab))
         >>> field = field.bind(sample)
-        >>> widget = zapi.getMultiAdapter((field, request), IDisplayWidget)
+        >>> widget = getMultiAdapter((field, request), IDisplayWidget)
         >>> isinstance(widget, ItemsMultiDisplayWidget)
         True
                 
@@ -212,7 +212,7 @@
     
         >>> field = fields.List(value_type=fields.Choice(vocabulary=vocab))
         >>> field = field.bind(sample)
-        >>> widget = zapi.getMultiAdapter((field, request), IInputWidget)
+        >>> widget = getMultiAdapter((field, request), IInputWidget)
         >>> isinstance(widget, OrderedMultiSelectWidget)
         True
     """

Modified: Zope3/trunk/src/zope/app/form/browser/tests/test_widgetdirective.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/tests/test_widgetdirective.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/tests/test_widgetdirective.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -17,6 +17,7 @@
 """
 import unittest
 
+import zope.component
 import zope.interface
 import zope.configuration.xmlconfig
 import zope.publisher.browser
@@ -28,8 +29,6 @@
 from zope.app.form.tests import utils
 import zope.app.testing.placelesssetup
 
-from zope.app import zapi
-
 __docformat__ = "reStructuredText"
 
 
@@ -72,7 +71,7 @@
 
     def get_widget(self, name, context):
         request = zope.publisher.browser.TestRequest()
-        view = zapi.getMultiAdapter((context, request), name=name)
+        view = zope.component.getMultiAdapter((context, request), name=name)
         return view.field_widget
 
     def test_addform_widget_without_class(self):

Modified: Zope3/trunk/src/zope/app/form/browser/textwidgets.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/textwidgets.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/browser/textwidgets.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -25,13 +25,12 @@
 from zope.i18n.format import DateTimeParseError
 
 from zope.app.form.interfaces import IInputWidget, ConversionError
+from zope.app.form.browser.i18n import _
 from zope.app.form.browser.interfaces import ITextBrowserWidget
 from zope.app.form.browser.widget import SimpleInputWidget, renderElement
 from zope.app.form.browser.widget import DisplayWidget
 
-from zope.app.i18n import ZopeMessageFactory as _
 
-
 def escape(str):
     if str is not None:
         str = saxutils.escape(str)

Modified: Zope3/trunk/src/zope/app/form/utility.py
===================================================================
--- Zope3/trunk/src/zope/app/form/utility.py	2007-03-24 23:49:37 UTC (rev 73521)
+++ Zope3/trunk/src/zope/app/form/utility.py	2007-03-24 23:51:08 UTC (rev 73522)
@@ -34,13 +34,13 @@
 """
 __docformat__ = 'restructuredtext'
 
+from zope import component
 from zope import security
 from zope.security.proxy import Proxy
 from zope.proxy import isProxy
 from zope.interface.interfaces import IMethod
 from zope.security.interfaces import ForbiddenAttribute, Unauthorized
 from zope.schema import getFieldsInOrder
-from zope.app import zapi
 from zope.app.form.interfaces import IWidget
 from zope.app.form.interfaces import WidgetsError, MissingInputError
 from zope.app.form.interfaces import InputErrors
@@ -62,7 +62,7 @@
 def _createWidget(context, field, viewType, request):
     """Creates a widget given a `context`, `field`, and `viewType`."""    
     field = field.bind(context)
-    return zapi.getMultiAdapter((field, request), viewType)
+    return component.getMultiAdapter((field, request), viewType)
 
 def _widgetHasStickyValue(widget):
     """Returns ``True`` if the widget has a sticky value.



More information about the Zope3-Checkins mailing list