Update of /cvsroot/pywin32/pywin32/win32/Demos
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21342/win32/Demos
Modified Files:
timer_demo.py win32gui_menu.py win32netdemo.py
win32rcparser_demo.py winprocess.py
Log Message:
Move to 'new style' exception raising.
Index: winprocess.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/winprocess.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** winprocess.py 3 Feb 2003 00:30:29 -0000 1.2
--- winprocess.py 1 Oct 2008 14:44:53 -0000 1.3
***************
*** 164,168 ****
if child.wait(mSec) != win32event.WAIT_OBJECT_0:
child.kill()
! raise WindowsError, 'process timeout exceeded'
return child.exitCode()
--- 164,168 ----
if child.wait(mSec) != win32event.WAIT_OBJECT_0:
child.kill()
! raise WindowsError('process timeout exceeded')
return child.exitCode()
Index: timer_demo.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/timer_demo.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** timer_demo.py 3 Feb 2003 00:30:29 -0000 1.4
--- timer_demo.py 1 Oct 2008 14:44:53 -0000 1.5
***************
*** 59,67 ****
# Message waiting.
if win32gui.PumpWaitingMessages():
! raise RuntimeError, "We got an unexpected WM_QUIT message!"
else:
# This wait timed-out.
if time.time()-start_time > 30:
! raise RuntimeError, "We timed out waiting for the timers to expire!"
if __name__=='__main__':
--- 59,67 ----
# Message waiting.
if win32gui.PumpWaitingMessages():
! raise RuntimeError("We got an unexpected WM_QUIT message!")
else:
# This wait timed-out.
if time.time()-start_time > 30:
! raise RuntimeError("We timed out waiting for the timers to expire!")
if __name__=='__main__':
Index: win32gui_menu.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** win32gui_menu.py 25 Jul 2008 01:26:33 -0000 1.8
--- win32gui_menu.py 1 Oct 2008 14:44:53 -0000 1.9
***************
*** 233,237 ****
state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND)
if state==-1:
! raise RuntimeError, "No item found"
if state & win32con.MF_CHECKED:
check_flags = win32con.MF_UNCHECKED
--- 233,237 ----
state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND)
if state==-1:
! raise RuntimeError("No item found")
if state & win32con.MF_CHECKED:
check_flags = win32con.MF_UNCHECKED
***************
*** 257,261 ****
if fState & win32con.MF_CHECKED != check_flags:
! raise RuntimeError, "The new item didn't get the new checked state!"
else:
print "OnCommand for ID", id
--- 257,261 ----
if fState & win32con.MF_CHECKED != check_flags:
! raise RuntimeError("The new item didn't get the new checked state!")
else:
print "OnCommand for ID", id
Index: win32netdemo.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32netdemo.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** win32netdemo.py 3 Feb 2003 00:30:29 -0000 1.5
--- win32netdemo.py 1 Oct 2008 14:44:53 -0000 1.6
***************
*** 167,171 ****
new = win32net.NetUserGetInfo(server, userName, 3)['usr_comment']
if str(new) != "Test comment":
! raise RuntimeError, "Could not read the same comment back - got %s" % new
print "Changed the data for the user"
finally:
--- 167,171 ----
new = win32net.NetUserGetInfo(server, userName, 3)['usr_comment']
if str(new) != "Test comment":
! raise RuntimeError("Could not read the same comment back - got %s" % new)
print "Changed the data for the user"
finally:
Index: win32rcparser_demo.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32rcparser_demo.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** win32rcparser_demo.py 26 May 2004 08:54:29 -0000 1.2
--- win32rcparser_demo.py 1 Oct 2008 14:44:53 -0000 1.3
***************
*** 19,23 ****
if not os.path.isfile(g_rcname):
! raise RuntimeError, "Can't locate test.rc (should be at '%s')" % (g_rcname,)
class DemoWindow:
--- 19,23 ----
if not os.path.isfile(g_rcname):
! raise RuntimeError("Can't locate test.rc (should be at '%s')" % (g_rcname,))
class DemoWindow:
|