[pywin32-checkins] pywin32/Pythonwin/pywin/tools hierlist.py, 1.7, 1.8 regedit.py, 1.2, 1.3
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-10-02 13:04:27
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18401/Pythonwin/pywin/tools Modified Files: hierlist.py regedit.py Log Message: More py3k compatible syntax modernizations merged from py3k branch. Index: regedit.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/regedit.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** regedit.py 9 Oct 1999 23:43:46 -0000 1.2 --- regedit.py 2 Oct 2008 13:03:55 -0000 1.3 *************** *** 8,15 **** def SafeApply( fn, args, err_desc = "" ): try: ! apply(fn, args) return 1 ! except win32api.error, (rc, fn, msg): ! msg = "Error " + err_desc + "\r\n\r\n" + msg win32ui.MessageBox(msg) return 0 --- 8,15 ---- def SafeApply( fn, args, err_desc = "" ): try: ! fn(*args) return 1 ! except win32api.error, exc: ! msg = "Error " + err_desc + "\r\n\r\n" + exc.strerror win32ui.MessageBox(msg) return 0 *************** *** 41,45 **** return 1 ! def OnItemDoubleClick(self,(hwndFrom, idFrom, code), extra): if idFrom==win32ui.AFX_IDW_PANE_FIRST: # Tree control --- 41,46 ---- return 1 ! def OnItemDoubleClick(self, info, extra): ! (hwndFrom, idFrom, code) = info if idFrom==win32ui.AFX_IDW_PANE_FIRST: # Tree control *************** *** 218,223 **** try: self.SetItemsCurrentValue(item, keyVal, d.newvalue) ! except win32api.error, (rc, fn, desc): ! win32ui.MessageBox("Error setting value\r\n\n%s" % desc) self.UpdateForRegItem(item) --- 219,224 ---- try: self.SetItemsCurrentValue(item, keyVal, d.newvalue) ! except win32api.error, exc: ! win32ui.MessageBox("Error setting value\r\n\n%s" % exc.strerror) self.UpdateForRegItem(item) *************** *** 227,231 **** val, type = win32api.RegQueryValueEx(hkey, valueName) if type != win32con.REG_SZ: ! raise TypeError, "Only strings can be edited" return val finally: --- 228,232 ---- val, type = win32api.RegQueryValueEx(hkey, valueName) if type != win32con.REG_SZ: ! raise TypeError("Only strings can be edited") return val finally: *************** *** 272,276 **** def OnOpenDocument (self, name): ! raise TypeError, "This template can not open files" return 0 --- 273,277 ---- def OnOpenDocument (self, name): ! raise TypeError("This template can not open files") return 0 Index: hierlist.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/hierlist.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** hierlist.py 1 Jul 2008 01:23:51 -0000 1.7 --- hierlist.py 2 Oct 2008 13:03:55 -0000 1.8 *************** *** 109,113 **** self.notify_parent = None # Break a possible cycle ! def OnTreeItemDoubleClick(self,(hwndFrom, idFrom, code), extra): if idFrom != self.listBoxId: return None item = self.itemHandleMap[self.list.GetSelectedItem()] --- 109,114 ---- self.notify_parent = None # Break a possible cycle ! def OnTreeItemDoubleClick(self, info, extra): ! (hwndFrom, idFrom, code) = info if idFrom != self.listBoxId: return None item = self.itemHandleMap[self.list.GetSelectedItem()] *************** *** 115,119 **** return 1 ! def OnTreeItemExpanding(self,(hwndFrom, idFrom, code), extra): if idFrom != self.listBoxId: return None action, itemOld, itemNew, pt = extra --- 116,121 ---- return 1 ! def OnTreeItemExpanding(self, info, extra): ! (hwndFrom, idFrom, code) = info if idFrom != self.listBoxId: return None action, itemOld, itemNew, pt = extra *************** *** 125,129 **** return 0 ! def OnTreeItemSelChanged(self,(hwndFrom, idFrom, code), extra): if idFrom != self.listBoxId: return None action, itemOld, itemNew, pt = extra --- 127,132 ---- return 0 ! def OnTreeItemSelChanged(self, info, extra): ! (hwndFrom, idFrom, code) = info if idFrom != self.listBoxId: return None action, itemOld, itemNew, pt = extra |