[Zope3-checkins] CVS: Zope3/src/zope/app/content - sql.py:1.3

Steve Alexander steve@cat-box.net
Thu, 20 Feb 2003 11:46:08 -0500


Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv29279/src/zope/app/content

Modified Files:
	sql.py 
Log Message:
Removed allowed_values=[(value,text),...] convention from widget.py --
it shouldn't have been there in the first place :)

Removed some unwanted whitespace, and flagged a bunch of opaque code
and bare except:s with XXX comments.


=== Zope3/src/zope/app/content/sql.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/content/sql.py:1.2	Wed Dec 25 09:12:48 2002
+++ Zope3/src/zope/app/content/sql.py	Thu Feb 20 11:46:07 2003
@@ -347,6 +347,7 @@
                     int(v)
                 else:
                     v = str(int(v))
+                # XXX Bare except!
             except:
                 if not v and args.has_key('optional') and args['optional']:
                     return 'null'
@@ -359,6 +360,7 @@
                     float(v)
                 else:
                     v = str(float(v))
+                # XXX Bare except!
             except:
                 if not v and args.has_key('optional') and args['optional']:
                     return 'null'
@@ -450,6 +452,7 @@
                         int(v)
                     else:
                         v = str(int(v))
+                    # XXX Bare except!
                 except:
                     raise ValueError, (
                         'Invalid integer value for **%s**' % name)
@@ -462,6 +465,7 @@
                         float(v)
                     else:
                         v = str(float(v))
+                    # XXX Bare except!
                 except:
                     raise ValueError, (
                         'Invalid floating-point value for **%s**' % name)
@@ -576,6 +580,7 @@
                 v = md[expr]
             else:
                 v = expr(md)
+            # XXX Bare except!
         except:
             if args.has_key('optional') and args['optional']:
                 return 'null'
@@ -605,6 +610,7 @@
                     float(v)
                 else:
                     v = str(float(v))
+                # XXX Bare except!
             except:
                 if not v and args.has_key('optional') and args['optional']:
                     return 'null'
@@ -654,8 +660,9 @@
 
     def setArguments(self, arguments):
         'See ISQLScript'
-        assert isinstance(arguments, StringTypes), \
+        assert isinstance(arguments, StringTypes), (
                '"arguments" argument of setArguments() must be a string'
+               )
         self._arg_string = arguments
         self._arguments = parseArguments(arguments)
 
@@ -713,16 +720,19 @@
             try:
                 # Try to find argument in keywords
                 arg_values[name] = kw[name]
+                # XXX Bare except!
             except:
                 # Okay, the first try failed, so let's try to find the default
                 arg = self._arguments[name]
                 try:
                     arg_values[name] = arg['default']
+                    # XXX Bare except!
                 except:
                     # Now the argument might be optional anyways; let's check
                     try:
                         if not arg['optional']:
                             missing.append(name)
+                        # XXX Bare except!
                     except:
                         missing.append(name)
 
@@ -846,16 +856,19 @@
             try:
                 # Try to find argument in keywords
                 arg_values[name] = kw[name]
+                # XXX Bare Except!
             except:
                 # Okay, the first try failed, so let's try to find the default
                 arg = self._arguments[name]
                 try:
                     arg_values[name] = arg['default']
+                    # XXX Bare except!
                 except:
                     # Now the argument might be optional anyways; let's check
                     try:
                         if not arg['optional']:
                             missing.append(name)
+                        # XXX Bare except!
                     except:
                         missing.append(name)