[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - metaconfigure.py:1.3 widget.py:1.45

Gary Poster gary at zope.com
Tue Aug 5 17:25:08 EDT 2003


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

Modified Files:
	metaconfigure.py widget.py 
Log Message:
a few small bugfixes.



=== Zope3/src/zope/app/browser/form/metaconfigure.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/metaconfigure.py:1.2	Tue Aug  5 11:23:17 2003
+++ Zope3/src/zope/app/browser/form/metaconfigure.py	Tue Aug  5 16:25:03 2003
@@ -57,7 +57,7 @@
     def __init__(self, _context, **kwargs):
         self._context = _context
         for key, value in kwargs.items():
-            if not(value is None and hasattr(self, key)):
+            if not (value is None and hasattr(self, key)):
                 setattr(self, key, value)
         self._normalize()
 
@@ -116,7 +116,7 @@
             if f not in self.fields:
                 raise ValueError(
                     'Field name is not in schema', 
-                    name, self.schema
+                    f, self.schema
                     )
         self.panes.append(Pane(fields, label))
 


=== Zope3/src/zope/app/browser/form/widget.py 1.44 => 1.45 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.44	Mon Aug  4 10:54:19 2003
+++ Zope3/src/zope/app/browser/form/widget.py	Tue Aug  5 16:25:03 2003
@@ -18,11 +18,10 @@
 __metaclass__ = type
 
 import re, cgi
+from xml.sax.saxutils import quoteattr
 import warnings
 from zope.app import zapi
-
 from zope.component import getService
-
 from zope.interface import implements
 from zope.proxy import removeAllProxies
 from zope.publisher.browser import BrowserView
@@ -1319,7 +1318,7 @@
 
     if 'style' in kw:
         if kw['style'] != '':
-            attr_list.append('style="%s"' % kw['style'])
+            attr_list.append('style=%s' % quoteattr(kw['style']))
         del kw['style']
 
     # special case handling for extra 'raw' code
@@ -1335,7 +1334,7 @@
     for key, value in items:
         if value == None:
             value = key
-        attr_list.append('%s="%s"' % (key, unicode(value)))
+        attr_list.append('%s=%s' % (key, quoteattr(unicode(value))))
 
     attr_str = " ".join(attr_list)
     return "<%s %s %s" % (tag, attr_str, extra)




More information about the Zope3-Checkins mailing list