Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/Pythonwin/pywin/Demos
Modified Files:
dibdemo.py fontdemo.py hiertest.py
Log Message:
Various modernizations to .py code via the py3k branch.
Index: hiertest.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/hiertest.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** hiertest.py 1 Sep 1999 23:33:35 -0000 1.1
--- hiertest.py 14 Nov 2008 00:22:25 -0000 1.2
***************
*** 17,21 ****
def GetSubList(self, item):
if os.path.isdir(item):
! ret = map(lambda path, base=item: os.path.join(base, path), os.listdir(item))
else:
ret = None
--- 17,21 ----
def GetSubList(self, item):
if os.path.isdir(item):
! ret = [os.path.join(item, fname) for fname in os.listdir(item)]
else:
ret = None
***************
*** 102,104 ****
demoboth()
else:
! demodlg()
\ No newline at end of file
--- 102,104 ----
demoboth()
else:
! demodlg()
Index: dibdemo.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/dibdemo.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** dibdemo.py 9 Aug 2008 16:46:41 -0000 1.2
--- dibdemo.py 14 Nov 2008 00:22:25 -0000 1.3
***************
*** 38,44 ****
if len(bPBM)>0:
magic=f.readline()
! if magic <> "P6\n":
print "The file is not a PBM format file"
! raise "Failed"
# check magic?
rowcollist=f.readline().split()
--- 38,44 ----
if len(bPBM)>0:
magic=f.readline()
! if magic != "P6\n":
print "The file is not a PBM format file"
! raise ValueError("Failed - The file is not a PBM format file")
# check magic?
rowcollist=f.readline().split()
Index: fontdemo.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/fontdemo.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** fontdemo.py 1 Sep 1999 23:33:35 -0000 1.1
--- fontdemo.py 14 Nov 2008 00:22:25 -0000 1.2
***************
*** 61,65 ****
self.width = right - left
self.height = bottom - top
! x, y = self.width / 2, self.height / 2
dc.TextOut (x, y, self.text)
--- 61,65 ----
self.width = right - left
self.height = bottom - top
! x, y = self.width // 2, self.height // 2
dc.TextOut (x, y, self.text)
|