summaryrefslogtreecommitdiff
path: root/Mac/Tools
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2004-02-12 17:35:32 +0000
committerWalter Dörwald <walter@livinglogic.de>2004-02-12 17:35:32 +0000
commit70a6b49821a3226f55e9716f32d802d06640cb89 (patch)
tree3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Mac/Tools
parentecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff)
downloadcpython-git-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Mac/Tools')
-rw-r--r--Mac/Tools/IDE/FontSettings.py10
-rw-r--r--Mac/Tools/IDE/PyDebugger.py2
-rw-r--r--Mac/Tools/IDE/PyDocSearch.py2
-rw-r--r--Mac/Tools/IDE/PyEdit.py12
-rw-r--r--Mac/Tools/IDE/PyFontify.py2
-rw-r--r--Mac/Tools/IDE/PythonIDEMain.py6
-rw-r--r--Mac/Tools/IDE/Wapplication.py4
-rw-r--r--Mac/Tools/IDE/Wbase.py10
-rw-r--r--Mac/Tools/IDE/Wsocket.py10
-rw-r--r--Mac/Tools/IDE/Wtraceback.py4
-rw-r--r--Mac/Tools/macfreeze/macfreezegui.py2
-rw-r--r--Mac/Tools/macfreeze/macgen_info.py2
-rw-r--r--Mac/Tools/macfreeze/macgenerate.py2
13 files changed, 33 insertions, 35 deletions
diff --git a/Mac/Tools/IDE/FontSettings.py b/Mac/Tools/IDE/FontSettings.py
index a41fcbd550..af2bd80320 100644
--- a/Mac/Tools/IDE/FontSettings.py
+++ b/Mac/Tools/IDE/FontSettings.py
@@ -51,7 +51,7 @@ class _FontDialog:
self.lasttab, self.tabmode = tabsettings
self.w.tabsizetitle = W.TextBox((10, -26, leftmargin2, 14), "Tabsize:", TextEdit.teJustRight)
self.w.tabsizeedit = W.EditText((leftmargin, -29, 40, 20), "", self.checktab)
- self.w.tabsizeedit.set(`self.lasttab`)
+ self.w.tabsizeedit.set(repr(self.lasttab))
radiobuttons = []
self.w.tabsizechars = W.RadioButton((leftmargin + 48, -26, 55, 14), "Spaces",
radiobuttons, self.toggletabmode)
@@ -97,7 +97,7 @@ class _FontDialog:
else:
# convert spaces to pixels
self.lasttab = spacewidth * tabsize
- self.w.tabsizeedit.set(`self.lasttab`)
+ self.w.tabsizeedit.set(repr(self.lasttab))
self.tabmode = tabmode
self.doit()
@@ -139,7 +139,7 @@ class _FontDialog:
for i in range(1, len(_stylenames)):
if self.w[i].get():
style = style | 2 ** (i - 1)
- #self.w.sample.set(`style`)
+ #self.w.sample.set(repr(style))
fontsettings, tabsettings = self.get()
self.w.sample.setfontsettings(fontsettings)
self.w.sample.settabsettings(tabsettings)
@@ -161,7 +161,7 @@ class _FontDialog:
self.doit()
else:
SysBeep(0)
- self.w.tabsizeedit.set(`self.lasttab`)
+ self.w.tabsizeedit.set(repr(self.lasttab))
self.w.tabsizeedit.selectall()
def checksize(self):
@@ -181,7 +181,7 @@ class _FontDialog:
self.doit()
else:
SysBeep(0)
- self.w.sizeedit.set(`self.lastsize`)
+ self.w.sizeedit.set(repr(self.lastsize))
self.w.sizeedit.selectall()
def doplain(self):
diff --git a/Mac/Tools/IDE/PyDebugger.py b/Mac/Tools/IDE/PyDebugger.py
index 18a089ed73..51ba753b46 100644
--- a/Mac/Tools/IDE/PyDebugger.py
+++ b/Mac/Tools/IDE/PyDebugger.py
@@ -511,7 +511,7 @@ class Debugger(bdb.Bdb):
return self.dispatch_return(frame, arg)
if event == 'exception':
return self.dispatch_exception(frame, arg)
- print 'bdb.Bdb.dispatch: unknown debugging event:', `event`
+ print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event)
return self.trace_dispatch
finally:
if hasattr(MacOS, 'EnableAppswitch'):
diff --git a/Mac/Tools/IDE/PyDocSearch.py b/Mac/Tools/IDE/PyDocSearch.py
index f9d2cb5a46..1abd4cd28e 100644
--- a/Mac/Tools/IDE/PyDocSearch.py
+++ b/Mac/Tools/IDE/PyDocSearch.py
@@ -75,7 +75,7 @@ class Status:
def set(self, path, hits):
self.w.searching.set(path)
- self.w.hits.set('Hits: ' + `hits`)
+ self.w.hits.set('Hits: %r' % (hits,))
app.breathe()
def close(self):
diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py
index 0ad7a8a58c..6826c65866 100644
--- a/Mac/Tools/IDE/PyEdit.py
+++ b/Mac/Tools/IDE/PyEdit.py
@@ -43,7 +43,7 @@ class Editor(W.Window):
if title:
self.title = title
else:
- self.title = "Untitled Script " + `_scriptuntitledcounter`
+ self.title = "Untitled Script %r" % (_scriptuntitledcounter,)
_scriptuntitledcounter = _scriptuntitledcounter + 1
text = ""
self._creator = W._signature
@@ -444,7 +444,7 @@ class Editor(W.Window):
try:
code = compile(pytext, filename, "exec")
except (SyntaxError, EOFError):
- raise buildtools.BuildError, "Syntax error in script %s" % `filename`
+ raise buildtools.BuildError, "Syntax error in script %r" % (filename,)
import tempfile
tmpdir = tempfile.mkdtemp()
@@ -1262,8 +1262,8 @@ class _EditorDefaultSettings:
self.w.picksizebutton = W.Button((8, 50, 80, 16), "Front window", self.picksize)
self.w.xsizelabel = W.TextBox((98, 32, 40, 14), "Width:")
self.w.ysizelabel = W.TextBox((148, 32, 40, 14), "Height:")
- self.w.xsize = W.EditText((98, 48, 40, 20), `self.windowsize[0]`)
- self.w.ysize = W.EditText((148, 48, 40, 20), `self.windowsize[1]`)
+ self.w.xsize = W.EditText((98, 48, 40, 20), repr(self.windowsize[0]))
+ self.w.ysize = W.EditText((148, 48, 40, 20), repr(self.windowsize[1]))
self.w.cancelbutton = W.Button((-180, -26, 80, 16), "Cancel", self.cancel)
self.w.okbutton = W.Button((-90, -26, 80, 16), "Done", self.ok)
@@ -1276,8 +1276,8 @@ class _EditorDefaultSettings:
editor = findeditor(self)
if editor is not None:
width, height = editor._parentwindow._bounds[2:]
- self.w.xsize.set(`width`)
- self.w.ysize.set(`height`)
+ self.w.xsize.set(repr(width))
+ self.w.ysize.set(repr(height))
else:
raise W.AlertError, "No edit window found"
diff --git a/Mac/Tools/IDE/PyFontify.py b/Mac/Tools/IDE/PyFontify.py
index 5680aa871a..eb37ad3428 100644
--- a/Mac/Tools/IDE/PyFontify.py
+++ b/Mac/Tools/IDE/PyFontify.py
@@ -152,4 +152,4 @@ def test(path):
f.close()
tags = fontify(text)
for tag, start, end, sublist in tags:
- print tag, `text[start:end]`
+ print tag, repr(text[start:end])
diff --git a/Mac/Tools/IDE/PythonIDEMain.py b/Mac/Tools/IDE/PythonIDEMain.py
index 29e9befa88..111a0b069a 100644
--- a/Mac/Tools/IDE/PythonIDEMain.py
+++ b/Mac/Tools/IDE/PythonIDEMain.py
@@ -394,7 +394,7 @@ class PythonIDE(Wapplication.Application):
if arg[0] == -50:
W.Message("Developer documentation not installed")
else:
- W.Message("AppleHelp Error: %s" % `arg`)
+ W.Message("AppleHelp Error: %r" % (arg,))
def domenu_lookuppython(self, *args):
from Carbon import AH
@@ -404,7 +404,7 @@ class PythonIDE(Wapplication.Application):
try:
AH.AHSearch("Python Documentation", searchstring)
except AH.Error, arg:
- W.Message("AppleHelp Error: %s" % `arg`)
+ W.Message("AppleHelp Error: %r" % (arg,))
def domenu_lookupcarbon(self, *args):
from Carbon import AH
@@ -414,7 +414,7 @@ class PythonIDE(Wapplication.Application):
try:
AH.AHSearch("Carbon", searchstring)
except AH.Error, arg:
- W.Message("AppleHelp Error: %s" % `arg`)
+ W.Message("AppleHelp Error: %r" % (arg,))
def _getsearchstring(self):
# First we get the frontmost window
diff --git a/Mac/Tools/IDE/Wapplication.py b/Mac/Tools/IDE/Wapplication.py
index ada441986b..a63be2a590 100644
--- a/Mac/Tools/IDE/Wapplication.py
+++ b/Mac/Tools/IDE/Wapplication.py
@@ -118,7 +118,7 @@ class Application(FrameWork.Application):
func()
except:
import sys
- sys.stderr.write("exception in idle function %s; killed:\n" % `func`)
+ sys.stderr.write("exception in idle function %r; killed:\n" % (func,))
traceback.print_exc()
self._idlefuncs.remove(func)
break
@@ -175,7 +175,7 @@ class Application(FrameWork.Application):
self.do_rawmenu(id, item, None, event)
return # here! we had a menukey!
#else:
- # print "XXX Command-" +`ch`
+ # print "XXX Command-%r" % ch
# See whether the front window wants it
if wid and self._windows.has_key(wid):
window = self._windows[wid]
diff --git a/Mac/Tools/IDE/Wbase.py b/Mac/Tools/IDE/Wbase.py
index 4c78b88215..a5d556b8ec 100644
--- a/Mac/Tools/IDE/Wbase.py
+++ b/Mac/Tools/IDE/Wbase.py
@@ -229,7 +229,7 @@ class Widget:
def _removewidget(self, key):
if not self._widgetsdict.has_key(key):
- raise KeyError, "no widget with key " + `key`
+ raise KeyError, "no widget with key %r" % (key,)
widget = self._widgetsdict[key]
for k in widget._widgetsdict.keys():
widget._removewidget(k)
@@ -502,8 +502,8 @@ class HorizontalPanes(Widget):
self._panebounds = []
for i in range(len(self._panesizes)):
panestart, paneend = self._panesizes[i]
- boundsstring = self.boundstemplate % (`panestart`, panestart and halfgutter,
- `paneend`, (paneend <> 1.0) and -halfgutter)
+ boundsstring = self.boundstemplate % (repr(panestart), panestart and halfgutter,
+ repr(paneend), (paneend <> 1.0) and -halfgutter)
self._panebounds.append(eval(boundsstring))
def installbounds(self):
@@ -684,9 +684,9 @@ def CallbackCall(callback, mustfit, *args):
return callback()
else:
if mustfit:
- raise TypeError, "callback accepts wrong number of arguments: " + `len(args)`
+ raise TypeError, "callback accepts wrong number of arguments: %r" % len(args)
else:
- raise TypeError, "callback accepts wrong number of arguments: 0 or " + `len(args)`
+ raise TypeError, "callback accepts wrong number of arguments: 0 or %r" % len(args)
def HasBaseClass(obj, class_):
diff --git a/Mac/Tools/IDE/Wsocket.py b/Mac/Tools/IDE/Wsocket.py
index e0077b2fe7..913797ce4d 100644
--- a/Mac/Tools/IDE/Wsocket.py
+++ b/Mac/Tools/IDE/Wsocket.py
@@ -129,14 +129,14 @@ class Connection(asyncore.dispatcher):
data = asyncore.dispatcher.recv(self, BUFSIZE)
if data:
if VERBOSE > 2:
- print "incoming ->", "%x" % id(self), `data`
+ print "incoming -> %x %r" % (id(self), data)
self.handle_incoming_data(data)
def handle_write(self):
if self._out_buffer:
sent = self.socket.send(self._out_buffer[:BUFSIZE])
if VERBOSE > 2:
- print "outgoing ->", "%x" % id(self), `self._out_buffer[:sent]`
+ print "outgoing -> %x %r" % (id(self), self._out_buffer[:sent])
self._out_buffer = self._out_buffer[sent:]
def close(self):
@@ -144,7 +144,7 @@ class Connection(asyncore.dispatcher):
self.readfunc(self._in_buffer)
self._in_buffer = ""
#elif VERBOSE > 1 and self._in_buffer:
- # print "--- there is unread data:", `self._in_buffer`
+ # print "--- there is unread data: %r", (self._in_buffer,)
asyncore.dispatcher.close(self)
def handle_close(self):
@@ -290,7 +290,7 @@ class PyConnection(Connection):
self.currentmessage = PyMessage()
def handle_object(self, object):
- print 'unhandled object:', `object`
+ print 'unhandled object:', repr(object)
def send(self, object):
import cPickle, zlib, struct
@@ -356,7 +356,7 @@ class HTTPProxy(Proxy):
def connectproxy(self, data):
if VERBOSE:
- print "--- proxy request", `data`
+ print "--- proxy request", repr(data)
addr, data = de_proxify(data)
other = Proxy(addr)
self.other = other
diff --git a/Mac/Tools/IDE/Wtraceback.py b/Mac/Tools/IDE/Wtraceback.py
index 51b54f36a0..90a25fe99d 100644
--- a/Mac/Tools/IDE/Wtraceback.py
+++ b/Mac/Tools/IDE/Wtraceback.py
@@ -147,9 +147,7 @@ class TraceBack:
tbline = ""
if os.path.exists(filename):
filename = os.path.split(filename)[1]
- tbline = 'File "' + filename + '", line ' + `lineno` + ', in ' + func
- else:
- tbline = 'File "' + filename + '", line ' + `lineno` + ', in ' + func
+ tbline = 'File "%s", line %r, in %r' % (filename, lineno, func)
if line:
tbline = tbline + '\r ' + line
self.textlist.append(tbline[:255])
diff --git a/Mac/Tools/macfreeze/macfreezegui.py b/Mac/Tools/macfreeze/macfreezegui.py
index 7921a29f7f..5dd3435b6d 100644
--- a/Mac/Tools/macfreeze/macfreezegui.py
+++ b/Mac/Tools/macfreeze/macfreezegui.py
@@ -113,7 +113,7 @@ def dialog(script=None):
try:
debug = string.atoi(string.strip(debug))
except ValueError:
- EasyDialogs.Message("Illegal debug value %s, set to zero."%`debug`)
+ EasyDialogs.Message("Illegal debug value %r, set to zero."%(debug,))
debug = 0
if gentype == ITEM_GENSOURCE:
return 'source', script, dirname, debug
diff --git a/Mac/Tools/macfreeze/macgen_info.py b/Mac/Tools/macfreeze/macgen_info.py
index 9ec6aa03d4..2d984c1ddd 100644
--- a/Mac/Tools/macfreeze/macgen_info.py
+++ b/Mac/Tools/macfreeze/macgen_info.py
@@ -4,5 +4,5 @@ def generate(output, module_dict):
for name in module_dict.keys():
print 'Include %-20s\t'%name,
module = module_dict[name]
- print module.gettype(), '\t', `module`
+ print module.gettype(), '\t', repr(module)
return 0
diff --git a/Mac/Tools/macfreeze/macgenerate.py b/Mac/Tools/macfreeze/macgenerate.py
index 6c60605bdc..dfa2047d40 100644
--- a/Mac/Tools/macfreeze/macgenerate.py
+++ b/Mac/Tools/macfreeze/macgenerate.py
@@ -4,5 +4,5 @@ def generate(program, module_dict):
for name in module_dict.keys():
print 'Include %-20s\t'%name,
module = module_dict[name]
- print module.gettype(), '\t', `module`
+ print module.gettype(), '\t', repr(module)
return 0