[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form -
widget.py:1.47.2.1
Sidnei da Silva
sidnei at x3ng.com.br
Tue Aug 12 14:39:26 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv32308/src/zope/app/browser/form
Modified Files:
Tag: dreamcatcher-ttwschema-branch
widget.py
Log Message:
A bit more progress on setting field's schema to the right types. More fixes on ZCML registration/security assertions of basic fields types.
=== Zope3/src/zope/app/browser/form/widget.py 1.47 => 1.47.2.1 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.47 Thu Aug 7 20:14:28 2003
+++ Zope3/src/zope/app/browser/form/widget.py Tue Aug 12 13:38:51 2003
@@ -95,7 +95,7 @@
>>> print widget.label()
<label for="test.foo">Foo</label>
>>> tearDown()
-
+
"""
implements(IBrowserWidget)
@@ -255,7 +255,7 @@
1
>>> int(widget.getData())
1
-
+
>>> def normalize(s):
... return '\\n '.join(s.split())
@@ -285,7 +285,7 @@
/>
Calling setData will change what gets output:
-
+
>>> widget.setData(False)
>>> print normalize( widget() )
<input
@@ -374,7 +374,7 @@
1
>>> widget.getData()
u'Bob'
-
+
>>> def normalize(s):
... return '\\n '.join(filter(None, s.split(' ')))
@@ -398,7 +398,7 @@
/>
Calling setData will change what gets output:
-
+
>>> widget.setData("Barry")
>>> print normalize( widget() )
<input
@@ -553,7 +553,7 @@
"""TextArea widget.
Multi-line text (unicode) input.
-
+
>>> from zope.publisher.browser import TestRequest
>>> from zope.schema import Text
>>> field = Text(__name__='foo', title=u'on')
@@ -563,7 +563,7 @@
1
>>> widget.getData()
u'Hello\\nworld!'
-
+
>>> def normalize(s):
... return '\\n '.join(filter(None, s.split(' ')))
@@ -587,7 +587,7 @@
/>
Calling setData will change what gets output:
-
+
>>> widget.setData("Hey\\ndude!")
>>> print normalize( widget() )
<textarea
@@ -617,7 +617,7 @@
value = super(TextAreaWidget, self)._unconvert(value)
if value:
value = value.replace("\n", "\r\n")
- return value
+ return value
def __call__(self):
return renderElement("textarea",
@@ -634,7 +634,7 @@
"""BytesArea widget.
Multi-line text (unicode) input.
-
+
>>> from zope.publisher.browser import TestRequest
>>> from zope.schema import Bytes
>>> field = Bytes(__name__='foo', title=u'on')
@@ -765,8 +765,8 @@
def renderItems(self, value):
name = self.name
# get items
- items = self.context.allowed_values
-
+ items = self.context.allowed_values
+
# check if we want to select first item
if (not value and getattr(self.context, 'firstItem', False)
and len(items) > 0):
@@ -1027,7 +1027,7 @@
widget = self._getWidget(i)
widget.setData(value)
r(widget()+'</td></tr>')
-
+
# possibly generate the "remove" and "add" buttons
s = ''
if render and num_items > min_length:
@@ -1127,7 +1127,7 @@
return []
field = self.context.value_type
- # pre-populate
+ # pre-populate
found = {}
for i in range(len(self._data)):
entry = self._data[i]
@@ -1157,7 +1157,7 @@
value = widget.getData()
found[i] = value
- # remove the indicated indexes
+ # remove the indicated indexes
for i in removing:
del found[i]
@@ -1229,7 +1229,7 @@
for name, widget in self.getSubWidgets():
r(widget.row())
r('</fieldset>')
-
+
return '\n'.join(render)
def getSubWidgets(self):
@@ -1369,4 +1369,4 @@
global tearDown
tearDown = zope.app.tests.placelesssetup.tearDown
tearDown()
-
+
More information about the Zope3-Checkins
mailing list