[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Formulator/Widgets/Browser - BrowserWidget.py:1.1.4.3

Jim Fulton jim@zope.com
Mon, 10 Jun 2002 15:34:46 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Formulator/Widgets/Browser
In directory cvs.zope.org:/tmp/cvs-serv5490/lib/python/Zope/App/Formulator/Widgets/Browser

Modified Files:
      Tag: Zope-3x-branch
	BrowserWidget.py 
Log Message:
Implemented 

http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/IContainerPythonification

Along the way:

- Converted most uses of has_key to use in.

- Fixed a bug in Interface names and namesAndDescriptions methods 
  that caused base class attributes to be missed.



=== Zope3/lib/python/Zope/App/Formulator/Widgets/Browser/BrowserWidget.py 1.1.4.2 => 1.1.4.3 ===
         """ """
         field = self.context
-        if REQUEST and REQUEST.has_key('field_'+field.id):
+        if REQUEST and (('field_'+field.id) in REQUEST):
             return REQUEST['field_'+field.id]
         else:
             return getAdapter(field, IPropertyFieldAdapter).\
@@ -83,13 +83,13 @@
     kw['name'] = 'field_' + kw['name']
 
     # special case handling for css_class
-    if kw.has_key('cssClass'):
+    if 'cssClass' in kw:
         if kw['cssClass'] != "":
             attr_list.append('class="%s"' % kw['cssClass'])
         del kw['cssClass']
 
     # special case handling for extra 'raw' code
-    if kw.has_key('extra'):
+    if 'extra' in kw:
         extra = kw['extra'] # could be empty string but we don't care
         del kw['extra']
     else:
@@ -106,7 +106,7 @@
 
 
 def renderElement(tag, **kw):
-    if kw.has_key('contents'):
+    if 'contents' in kw:
         contents = kw['contents']
         del kw['contents']
         return "%s>%s</%s>" % (apply(renderTag, (tag,), kw), contents, tag)