Update of /cvsroot/pywin32/pywin32/win32/Demos
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18926/win32/Demos
Modified Files:
win32gui_demo.py win32gui_dialog.py
Log Message:
modernizations: replace most remaining has_key() calls with 'in' statements.
Index: win32gui_demo.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_demo.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** win32gui_demo.py 22 Feb 2007 20:45:08 -0000 1.6
--- win32gui_demo.py 27 Nov 2008 09:42:42 -0000 1.7
***************
*** 15,19 ****
win32gui.EnumWindows(_MyCallback, (windows, classes))
print "Enumerated a total of %d windows with %d classes" % (len(windows),len(classes))
! if not classes.has_key("tooltips_class32"):
print "Hrmmmm - I'm very surprised to not find a 'tooltips_class32' class."
--- 15,19 ----
win32gui.EnumWindows(_MyCallback, (windows, classes))
print "Enumerated a total of %d windows with %d classes" % (len(windows),len(classes))
! if "tooltips_class32" not in classes:
print "Hrmmmm - I'm very surprised to not find a 'tooltips_class32' class."
Index: win32gui_dialog.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_dialog.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** win32gui_dialog.py 27 Nov 2008 05:58:17 -0000 1.10
--- win32gui_dialog.py 27 Nov 2008 09:42:42 -0000 1.11
***************
*** 45,54 ****
full_fmt += fmt
for name, val in kw.items():
! if not self.__dict__.has_key(name):
raise ValueError("LVITEM structures do not have an item '%s'" % (name,))
self.__dict__[name] = val
def __setattr__(self, attr, val):
! if not attr.startswith("_") and not self.__dict__.has_key(attr):
raise AttributeError(attr)
self.__dict__[attr] = val
--- 45,54 ----
full_fmt += fmt
for name, val in kw.items():
! if name not in self.__dict__:
raise ValueError("LVITEM structures do not have an item '%s'" % (name,))
self.__dict__[name] = val
def __setattr__(self, attr, val):
! if not attr.startswith("_") and attr not in self.__dict__:
raise AttributeError(attr)
self.__dict__[attr] = val
|