Changeset 4183
- Timestamp:
- 06/25/2008 04:52:42 PM (2 months ago)
- Files:
-
- trunk/dabo/lib/DesignerXmlConverter.py (modified) (4 diffs)
- trunk/dabo/lib/SimpleCrypt.py (modified) (1 diff)
- trunk/dabo/lib/autosuper/setup.py (modified) (1 diff)
- trunk/dabo/lib/connParser.py (modified) (1 diff)
- trunk/dabo/lib/datanav/Bizobj.py (modified) (1 diff)
- trunk/dabo/lib/datanav/Form.py (modified) (4 diffs)
- trunk/dabo/lib/datanav/Page.py (modified) (1 diff)
- trunk/dabo/lib/datanav2/Bizobj.py (modified) (1 diff)
- trunk/dabo/lib/datanav2/Form.py (modified) (2 diffs)
- trunk/dabo/lib/datanav2/Page.py (modified) (1 diff)
- trunk/dabo/lib/dates.py (modified) (2 diffs)
- trunk/dabo/lib/eventMixin.py (modified) (2 diffs)
- trunk/dabo/lib/propertyHelperMixin.py (modified) (3 diffs)
- trunk/dabo/lib/reportUtils.py (modified) (1 diff)
- trunk/dabo/lib/reportWriter.py (modified) (3 diffs)
- trunk/dabo/lib/test/test_utils.py (modified) (1 diff)
- trunk/dabo/lib/utils.py (modified) (2 diffs)
- trunk/dabo/lib/uuid.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/lib/DesignerXmlConverter.py
r4117 r4183 744 744 try: 745 745 currSizer = sizerDict[currParent].pop() 746 except: pass 746 except (KeyError, IndexError): 747 pass 747 748 """ 748 749 self._grdPgfText = """ parentStack.append(currParent) … … 770 771 try: 771 772 currSizer = sizerDict[currParent].pop() 772 except: pass 773 except (KeyError, IndexError): 774 pass 773 775 else: 774 776 currSizer = None … … 810 812 try: 811 813 currSizer = sizerDict[currParent].pop() 812 except: pass 814 except (KeyError, IndexError): 815 pass 813 816 else: 814 817 currSizer = None … … 821 824 try: 822 825 currSizer = sizerDict[currParent].pop() 823 except: pass 826 except (KeyError, IndexError): 827 pass 824 828 """ 825 829 self._innerPropText = """ %(prop)s = property(%(pdg)s, %(pds)s, %(pdd)s, trunk/dabo/lib/SimpleCrypt.py
r3054 r4183 52 52 chunks = [chr(int(aString[i] + aString[i+1], 16)) 53 53 for i in range(0, len(aString), 2)] 54 except :55 raise ValueError, "Incorrectly-encrypted password"54 except IndexError: 55 raise ValueError, _("Incorrectly-encrypted password") 56 56 return "".join(chunks) 57 57 trunk/dabo/lib/autosuper/setup.py
r3054 r4183 39 39 setup(**pyrex_commands) 40 40 41 except: 42 raise 41 except ImportError, e: 43 42 setup(**params) 43 raise e trunk/dabo/lib/connParser.py
r3237 r4183 107 107 escQuote(d["database"], noQuote=True), escQuote(d["user"], noQuote=True), 108 108 escQuote(d["password"], noQuote=True), d["port"]) 109 except :109 except KeyError: 110 110 # Not a valid conn info dict 111 111 ret = "" trunk/dabo/lib/datanav/Bizobj.py
r3054 r4183 17 17 cursorInfo, alias = fld.split(" as ") 18 18 table, field = cursorInfo.split(".") 19 except :19 except ValueError: 20 20 # if fld wasn't sent as the conventional "table.field as alias", 21 21 # then there's nothing to automatically do. trunk/dabo/lib/datanav/Form.py
r3335 r4183 89 89 try: 90 90 os.remove(f) 91 except :91 except OSError: 92 92 # perhaps it is already gone, removed explicitly. 93 93 pass … … 329 329 self.pageFrame.release() 330 330 del self.__dict__["PageFrame"] 331 except: pass 331 except KeyError: 332 pass 332 333 333 334 if self.beforeSetupPageFrame(): … … 627 628 try: 628 629 ret = self._allFieldSpecs[tbl] 629 except: pass 630 except KeyError: 631 pass 630 632 return ret 631 633 … … 853 855 try: 854 856 c.Alignment 855 except :857 except AttributeError: 856 858 continue 857 859 objects.append(((c.Left, c.Top + currentY), c)) trunk/dabo/lib/datanav/Page.py
r3754 r4183 166 166 try: 167 167 del self.sortFields[self.sortDS] 168 except :168 except KeyError: 169 169 pass 170 170 elif action== "show": trunk/dabo/lib/datanav2/Bizobj.py
r3054 r4183 17 17 cursorInfo, alias = fld.split(" as ") 18 18 table, field = cursorInfo.split(".") 19 except :19 except ValueError: 20 20 # if fld wasn't sent as the conventional "table.field as alias", 21 21 # then there's nothing to automatically do. trunk/dabo/lib/datanav2/Form.py
r3718 r4183 257 257 self.pageFrame.release() 258 258 del self.__dict__["PageFrame"] 259 except : pass259 except KeyError: pass 260 260 261 261 if self.beforeSetupPageFrame(): … … 692 692 try: 693 693 c.DataField 694 except :694 except AttributeError: 695 695 continue 696 696 objects.append(((c.Left, c.Top + currentY), c)) trunk/dabo/lib/datanav2/Page.py
r4045 r4183 165 165 try: 166 166 del self.sortFields[self.sortDS] 167 except :167 except KeyError: 168 168 pass 169 169 elif action== "show": trunk/dabo/lib/dates.py
r3944 r4183 147 147 try: 148 148 ret = datetime.date(*time.strptime(strVal, "%x")[:3]) 149 except :149 except IndexError: 150 150 pass 151 151 return ret … … 218 218 try: 219 219 ret = datetime.datetime(*time.strptime(strVal, "%x %X")) 220 except :220 except IndexError: 221 221 pass 222 222 return ret trunk/dabo/lib/eventMixin.py
r4119 r4183 109 109 try: 110 110 self.__raisedEvents.pop() 111 except :111 except (AttributeError, IndexError): 112 112 # This is a deleted object; no need (or ability!) to do anything else. 113 113 return … … 210 210 try: 211 211 parent = parent.Parent 212 except :212 except AttributeError: 213 213 parent = self.Form 214 214 stop = True trunk/dabo/lib/propertyHelperMixin.py
r3986 r4183 187 187 self._setName(_propDict[prop]) 188 188 continue 189 except :189 except AttributeError: 190 190 # Not a class that implements _setName() 191 191 pass … … 231 231 else: 232 232 raise AttributeError, "'%s' is not a property." % prop 233 if isinstance(eval("self.%s" % prop), basestring): 234 # If this is property holds strings, we need to quote the value. 235 try: 236 exec("self.%s = '%s'" % (prop, val) ) 237 except: 238 raise ValueError, "Could not set property '%s' to value: %s" % (prop, val) 239 else: 240 try: 241 exec("self.%s = %s" % (prop, val) ) 242 except: 243 # Still could be a string, if the original value was None 244 try: 245 exec("self.%s = '%s'" % (prop, val) ) 246 except: 247 raise ValueError, "Could not set property '%s' to value: %s" % (prop, val) 233 setattr(self, prop, val) 234 # if isinstance(eval("self.%s" % prop), basestring): 235 # # If this is property holds strings, we need to quote the value. 236 # try: 237 # exec("self.%s = '%s'" % (prop, val) ) 238 # except : 239 # raise ValueError, "Could not set property '%s' to value: %s" % (prop, val) 240 # else: 241 # try: 242 # exec("self.%s = %s" % (prop, val) ) 243 # except: 244 # # Still could be a string, if the original value was None 245 # try: 246 # exec("self.%s = '%s'" % (prop, val) ) 247 # except: 248 # raise ValueError, "Could not set property '%s' to value: %s" % (prop, val) 248 249 249 250 … … 315 316 try: 316 317 propVal = propRef.fget(cls) 317 except :318 except AttributeError: 318 319 # There are many reasons the propval may not be determined for now, 319 320 # such as not being a live instance. trunk/dabo/lib/reportUtils.py
r4033 r4183 25 25 try: 26 26 os.remove(f) 27 except :27 except OSError: 28 28 pass 29 29 trunk/dabo/lib/reportWriter.py
r4037 r4183 959 959 c.setFont(fontName, fontSize) 960 960 except: 961 ### FIXME 961 962 # An unavailable fontName was likely specified. The rw docs promise to 962 963 # default to Helvetica in this case. … … 1236 1237 c.drawImage(imageData, 0, 0, width, height, mask) 1237 1238 except: 1239 ### FIXME 1238 1240 pass 1239 1241 ## All done, restore the canvas state to how we found it (important because … … 1499 1501 ev = eval(show) 1500 1502 except: 1503 ### FIXME 1501 1504 ## expression failed to eval: default to True (show it) 1502 1505 ev = True trunk/dabo/lib/test/test_utils.py
r3752 r4183 25 25 try: 26 26 shutil.rmtree(self.tempTestDir) 27 except :27 except OSError: 28 28 pass 29 29 os.mkdir(self.tempTestDir) trunk/dabo/lib/utils.py
r4099 r4183 62 62 # os.path.expanduser should work on all posix systems (*nix, Mac, and some 63 63 # Windows NT setups): 64 try: 65 hd = os.path.expanduser("~") 66 except: 67 pass 64 hd = os.path.expanduser("~") 68 65 69 66 # If for some reason the posix function above didn't work, most Linux setups … … 123 120 try: 124 121 os.makedirs(dd) 125 except :122 except OSError: 126 123 sys.stderr.write("Couldn't create the user setting directory (%s)." % dd) 127 124 dd = None trunk/dabo/lib/uuid.py
r3054 r4183 298 298 dirs.insert(0, buffer.value.decode('mbcs')) 299 299 except: 300 ### FIXME 300 301 pass 301 302 for dir in dirs: … … 352 353 lib = ctypes.CDLL(ctypes.util.find_library(libname)) 353 354 except: 355 ### FIXME 354 356 continue 355 357 if hasattr(lib, 'uuid_generate_random'): … … 365 367 lib = ctypes.windll.rpcrt4 366 368 except: 369 ### FIXME 367 370 lib = None 368 371 _UuidCreate = getattr(lib, 'UuidCreateSequential', 369 372 getattr(lib, 'UuidCreate', None)) 370 373 except: 374 ### FIXME 371 375 pass 372 376 … … 408 412 _node = getter() 409 413 except: 414 ### FIXME 410 415 continue 411 416 if _node is not None: … … 461 466 return UUID(bytes=os.urandom(16), version=4) 462 467 except: 468 ### FIXME 463 469 import random 464 470 bytes = [chr(random.randrange(256)) for i in range(16)]
