summaryrefslogtreecommitdiffstats
path: root/Mac/Demo
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2004-02-12 17:35:32 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2004-02-12 17:35:32 (GMT)
commit70a6b49821a3226f55e9716f32d802d06640cb89 (patch)
tree3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Mac/Demo
parentecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff)
downloadcpython-70a6b49821a3226f55e9716f32d802d06640cb89.zip
cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz
cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.bz2
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Mac/Demo')
-rw-r--r--Mac/Demo/PICTbrowse/ICONbrowse.py6
-rw-r--r--Mac/Demo/PICTbrowse/PICTbrowse.py8
-rw-r--r--Mac/Demo/PICTbrowse/PICTbrowse2.py6
-rw-r--r--Mac/Demo/PICTbrowse/cicnbrowse.py6
-rw-r--r--Mac/Demo/PICTbrowse/oldPICTbrowse.py8
-rw-r--r--Mac/Demo/calldll/testcalldll.py4
-rw-r--r--Mac/Demo/imgbrowse/imgbrowse.py2
-rw-r--r--Mac/Demo/mlte/mlted.py2
-rw-r--r--Mac/Demo/resources/listres.py4
-rw-r--r--Mac/Demo/textedit/ped.py2
-rw-r--r--Mac/Demo/waste/htmled.py8
-rw-r--r--Mac/Demo/waste/swed.py4
-rw-r--r--Mac/Demo/waste/wed.py2
13 files changed, 31 insertions, 31 deletions
diff --git a/Mac/Demo/PICTbrowse/ICONbrowse.py b/Mac/Demo/PICTbrowse/ICONbrowse.py
index 42ae96d..1194b7e 100644
--- a/Mac/Demo/PICTbrowse/ICONbrowse.py
+++ b/Mac/Demo/PICTbrowse/ICONbrowse.py
@@ -52,7 +52,7 @@ class ICONbrowse(FrameWork.Application):
def showICON(self, resid):
w = ICONwindow(self)
w.open(resid)
- #EasyDialogs.Message('Show ICON '+`resid`)
+ #EasyDialogs.Message('Show ICON %r' % (resid,))
def findICONresources(self):
num = Res.CountResources('ICON')
@@ -70,7 +70,7 @@ class ICONbrowse(FrameWork.Application):
class ICONwindow(FrameWork.Window):
def open(self, (resid, resname)):
if not resname:
- resname = '#'+`resid`
+ resname = '#%r' % (resid,)
self.resid = resid
self.picture = Icn.GetIcon(self.resid)
l, t, r, b = 0, 0, 32, 32
@@ -127,7 +127,7 @@ class MyDialog(FrameWork.DialogWindow):
if self.contents:
self.list.LAddRow(len(self.contents), 0)
for i in range(len(self.contents)):
- v = `self.contents[i][0]`
+ v = repr(self.contents[i][0])
if self.contents[i][1]:
v = v + '"' + self.contents[i][1] + '"'
self.list.LSetCell(v, (0, i))
diff --git a/Mac/Demo/PICTbrowse/PICTbrowse.py b/Mac/Demo/PICTbrowse/PICTbrowse.py
index 41ffa5c..eace869 100644
--- a/Mac/Demo/PICTbrowse/PICTbrowse.py
+++ b/Mac/Demo/PICTbrowse/PICTbrowse.py
@@ -47,7 +47,7 @@ class PICTbrowse(FrameWork.Application):
def showPICT(self, resid):
w = PICTwindow(self)
w.open(resid)
- #EasyDialogs.Message('Show PICT '+`resid`)
+ #EasyDialogs.Message('Show PICT %r' % (resid,))
def findPICTresources(self):
num = Res.CountResources('PICT')
@@ -65,11 +65,11 @@ class PICTbrowse(FrameWork.Application):
class PICTwindow(FrameWork.Window):
def open(self, (resid, resname)):
if not resname:
- resname = '#'+`resid`
+ resname = '#%r' % (resid,)
self.resid = resid
picture = Qd.GetPicture(self.resid)
# Get rect for picture
- print `picture.data[:16]`
+ print repr(picture.data[:16])
sz, t, l, b, r = struct.unpack('hhhhh', picture.data[:10])
print 'pict:', t, l, b, r
width = r-l
@@ -105,7 +105,7 @@ class MyDialog(FrameWork.DialogWindow):
if self.contents:
self.list.LAddRow(len(self.contents), 0)
for i in range(len(self.contents)):
- v = `self.contents[i][0]`
+ v = repr(self.contents[i][0])
if self.contents[i][1]:
v = v + '"' + self.contents[i][1] + '"'
self.list.LSetCell(v, (0, i))
diff --git a/Mac/Demo/PICTbrowse/PICTbrowse2.py b/Mac/Demo/PICTbrowse/PICTbrowse2.py
index da389c0..875c99b 100644
--- a/Mac/Demo/PICTbrowse/PICTbrowse2.py
+++ b/Mac/Demo/PICTbrowse/PICTbrowse2.py
@@ -51,7 +51,7 @@ class PICTbrowse(FrameWork.Application):
def showPICT(self, resid):
w = PICTwindow(self)
w.open(resid)
- #EasyDialogs.Message('Show PICT '+`resid`)
+ #EasyDialogs.Message('Show PICT %r' % (resid,))
def findPICTresources(self):
num = Res.CountResources('PICT')
@@ -69,7 +69,7 @@ class PICTbrowse(FrameWork.Application):
class PICTwindow(FrameWork.Window):
def open(self, (resid, resname)):
if not resname:
- resname = '#'+`resid`
+ resname = '#%r' % (resid,)
self.resid = resid
self.picture = Qd.GetPicture(self.resid)
# Get rect for picture
@@ -127,7 +127,7 @@ class MyDialog(FrameWork.DialogWindow):
if self.contents:
self.list.LAddRow(len(self.contents), 0)
for i in range(len(self.contents)):
- v = `self.contents[i][0]`
+ v = repr(self.contents[i][0])
if self.contents[i][1]:
v = v + '"' + self.contents[i][1] + '"'
self.list.LSetCell(v, (0, i))
diff --git a/Mac/Demo/PICTbrowse/cicnbrowse.py b/Mac/Demo/PICTbrowse/cicnbrowse.py
index b90143e..e3d7972 100644
--- a/Mac/Demo/PICTbrowse/cicnbrowse.py
+++ b/Mac/Demo/PICTbrowse/cicnbrowse.py
@@ -52,7 +52,7 @@ class CIconbrowse(FrameWork.Application):
def showCIcon(self, resid):
w = CIconwindow(self)
w.open(resid)
- #EasyDialogs.Message('Show cicn '+`resid`)
+ #EasyDialogs.Message('Show cicn %r' % (resid,))
def findcicnresources(self):
num = Res.CountResources('cicn')
@@ -70,7 +70,7 @@ class CIconbrowse(FrameWork.Application):
class CIconwindow(FrameWork.Window):
def open(self, (resid, resname)):
if not resname:
- resname = '#'+`resid`
+ resname = '#%r' % (resid,)
self.resid = resid
self.picture = Icn.GetCIcon(self.resid)
l, t, r, b = 0, 0, 32, 32
@@ -127,7 +127,7 @@ class MyDialog(FrameWork.DialogWindow):
if self.contents:
self.list.LAddRow(len(self.contents), 0)
for i in range(len(self.contents)):
- v = `self.contents[i][0]`
+ v = repr(self.contents[i][0])
if self.contents[i][1]:
v = v + '"' + self.contents[i][1] + '"'
self.list.LSetCell(v, (0, i))
diff --git a/Mac/Demo/PICTbrowse/oldPICTbrowse.py b/Mac/Demo/PICTbrowse/oldPICTbrowse.py
index dc1f5b4..5f5893c 100644
--- a/Mac/Demo/PICTbrowse/oldPICTbrowse.py
+++ b/Mac/Demo/PICTbrowse/oldPICTbrowse.py
@@ -46,7 +46,7 @@ class PICTbrowse(FrameWork.Application):
def showPICT(self, resid):
w = PICTwindow(self)
w.open(resid)
- #EasyDialogs.Message('Show PICT '+`resid`)
+ #EasyDialogs.Message('Show PICT %r' % (resid,))
def findPICTresources(self):
num = Res.CountResources('PICT')
@@ -64,11 +64,11 @@ class PICTbrowse(FrameWork.Application):
class PICTwindow(FrameWork.Window):
def open(self, (resid, resname)):
if not resname:
- resname = '#'+`resid`
+ resname = '#%r' % (resid,)
self.resid = resid
picture = Qd.GetPicture(self.resid)
# Get rect for picture
- print `picture.data[:16]`
+ print repr(picture.data[:16])
sz, t, l, b, r = struct.unpack('hhhhh', picture.data[:10])
print 'pict:', t, l, b, r
width = r-l
@@ -104,7 +104,7 @@ class MyDialog(FrameWork.DialogWindow):
if self.contents:
self.list.LAddRow(len(self.contents), 0)
for i in range(len(self.contents)):
- v = `self.contents[i][0]`
+ v = repr(self.contents[i][0])
if self.contents[i][1]:
v = v + '"' + self.contents[i][1] + '"'
self.list.LSetCell(v, (0, i))
diff --git a/Mac/Demo/calldll/testcalldll.py b/Mac/Demo/calldll/testcalldll.py
index cdb24c3..d4a4853 100644
--- a/Mac/Demo/calldll/testcalldll.py
+++ b/Mac/Demo/calldll/testcalldll.py
@@ -99,7 +99,7 @@ rv = cdll_N_pp('pascal string')
if rv == 'Was: pascal string':
print 'ok.'
else:
- print 'Failed, returned', `rv`
+ print 'Failed, returned', repr(rv)
print 'Test cdll_N_bb'
rv = cdll_N_bb(-100)
@@ -128,5 +128,5 @@ rv = cdll_N_sH('new data', h)
if rv == None and h.data == 'new data':
print 'ok.'
else:
- print 'Failed, rv is', rv, 'and handle data is', `rv.data`
+ print 'Failed, rv is', rv, 'and handle data is', repr(rv.data)
sys.exit(1)
diff --git a/Mac/Demo/imgbrowse/imgbrowse.py b/Mac/Demo/imgbrowse/imgbrowse.py
index d8164ea..262c650 100644
--- a/Mac/Demo/imgbrowse/imgbrowse.py
+++ b/Mac/Demo/imgbrowse/imgbrowse.py
@@ -53,7 +53,7 @@ class imgbrowse(FrameWork.Application):
try:
rdr = img.reader(imgformat.macrgb16, pathname)
except img.error, arg:
- EasyDialogs.Message(`arg`)
+ EasyDialogs.Message(repr(arg))
return
w, h = rdr.width, rdr.height
bar.set(10)
diff --git a/Mac/Demo/mlte/mlted.py b/Mac/Demo/mlte/mlted.py
index 53f9f5d..381345a 100644
--- a/Mac/Demo/mlte/mlted.py
+++ b/Mac/Demo/mlte/mlted.py
@@ -276,7 +276,7 @@ class Mlted(Application):
data = fp.read()
fp.close()
except IOError, arg:
- EasyDialogs.Message("IOERROR: "+`arg`)
+ EasyDialogs.Message("IOERROR: %r" % (arg,))
return
else:
path = None
diff --git a/Mac/Demo/resources/listres.py b/Mac/Demo/resources/listres.py
index 7575db8..eacf2b7 100644
--- a/Mac/Demo/resources/listres.py
+++ b/Mac/Demo/resources/listres.py
@@ -7,7 +7,7 @@ def list1resources():
ntypes = Res.Count1Types()
for itype in range(1, 1+ntypes):
type = Res.Get1IndType(itype)
- print "Type:", `type`
+ print "Type:", repr(type)
nresources = Res.Count1Resources(type)
for i in range(1, 1 + nresources):
Res.SetResLoad(0)
@@ -19,7 +19,7 @@ def listresources():
ntypes = Res.CountTypes()
for itype in range(1, 1+ntypes):
type = Res.GetIndType(itype)
- print "Type:", `type`
+ print "Type:", repr(type)
nresources = Res.CountResources(type)
for i in range(1, 1 + nresources):
Res.SetResLoad(0)
diff --git a/Mac/Demo/textedit/ped.py b/Mac/Demo/textedit/ped.py
index 80cf7e5..eee848b 100644
--- a/Mac/Demo/textedit/ped.py
+++ b/Mac/Demo/textedit/ped.py
@@ -274,7 +274,7 @@ class Ped(Application):
data = fp.read()
fp.close()
except IOError, arg:
- EasyDialogs.Message("IOERROR: "+`arg`)
+ EasyDialogs.Message("IOERROR: %r" % (arg,))
return
else:
path = None
diff --git a/Mac/Demo/waste/htmled.py b/Mac/Demo/waste/htmled.py
index d415de1..8710766 100644
--- a/Mac/Demo/waste/htmled.py
+++ b/Mac/Demo/waste/htmled.py
@@ -516,7 +516,7 @@ class Wed(Application):
self.sizemenu = Menu(self.menubar, "Size")
self.sizeitems = []
for n in SIZES:
- m = MenuItem(self.sizemenu, `n`, "", self.selsize)
+ m = MenuItem(self.sizemenu, repr(n), "", self.selsize)
self.sizeitems.append(m)
self.sizemenu.addseparator()
self.sizeitem_bigger = MenuItem(self.sizemenu, "Bigger", "+",
@@ -670,7 +670,7 @@ class Wed(Application):
data = fp.read()
fp.close()
except IOError, arg:
- EasyDialogs.Message("IOERROR: "+`arg`)
+ EasyDialogs.Message("IOERROR: %r" % (arg,))
return
else:
path = None
@@ -688,7 +688,7 @@ class Wed(Application):
try:
fp = open(path, 'rb') # NOTE binary, we need cr as end-of-line
except IOError, arg:
- EasyDialogs.Message("IOERROR: "+`arg`)
+ EasyDialogs.Message("IOERROR: %r" % (args,))
return
self.active.menu_insert(fp)
else:
@@ -702,7 +702,7 @@ class Wed(Application):
try:
fp = open(path, 'r')
except IOError, arg:
- EasyDialogs.Message("IOERROR: "+`arg`)
+ EasyDialogs.Message("IOERROR: %r" % (arg,))
return
self.active.menu_insert_html(fp)
else:
diff --git a/Mac/Demo/waste/swed.py b/Mac/Demo/waste/swed.py
index c85cb21..ca77293 100644
--- a/Mac/Demo/waste/swed.py
+++ b/Mac/Demo/waste/swed.py
@@ -375,7 +375,7 @@ class Wed(Application):
self.sizemenu = Menu(self.menubar, "Size")
self.sizeitems = []
for n in SIZES:
- m = MenuItem(self.sizemenu, `n`, "", self.selsize)
+ m = MenuItem(self.sizemenu, repr(n), "", self.selsize)
self.sizeitems.append(m)
self.sizemenu.addseparator()
self.sizeitem_bigger = MenuItem(self.sizemenu, "Bigger", "+",
@@ -529,7 +529,7 @@ class Wed(Application):
data = fp.read()
fp.close()
except IOError, arg:
- EasyDialogs.Message("IOERROR: "+`arg`)
+ EasyDialogs.Message("IOERROR: %r" % (arg,))
return
else:
path = None
diff --git a/Mac/Demo/waste/wed.py b/Mac/Demo/waste/wed.py
index 7161ae5..5d84b40 100644
--- a/Mac/Demo/waste/wed.py
+++ b/Mac/Demo/waste/wed.py
@@ -338,7 +338,7 @@ class Wed(Application):
data = fp.read()
fp.close()
except IOError, arg:
- EasyDialogs.Message("IOERROR: "+`arg`)
+ EasyDialogs.Message("IOERROR: %r" % (arg,))
return
else:
path = None