diff options
author | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
commit | 70a6b49821a3226f55e9716f32d802d06640cb89 (patch) | |
tree | 3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Demo/pdist | |
parent | ecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff) | |
download | cpython-70a6b49821a3226f55e9716f32d802d06640cb89.zip cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.bz2 |
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Demo/pdist')
-rwxr-xr-x | Demo/pdist/RCSProxy.py | 2 | ||||
-rwxr-xr-x | Demo/pdist/client.py | 2 | ||||
-rwxr-xr-x | Demo/pdist/cmdfw.py | 6 | ||||
-rwxr-xr-x | Demo/pdist/cmptree.py | 10 | ||||
-rwxr-xr-x | Demo/pdist/cvslock.py | 2 | ||||
-rwxr-xr-x | Demo/pdist/rcslib.py | 4 | ||||
-rwxr-xr-x | Demo/pdist/server.py | 4 |
7 files changed, 15 insertions, 15 deletions
diff --git a/Demo/pdist/RCSProxy.py b/Demo/pdist/RCSProxy.py index 7212ca6..87c65cc 100755 --- a/Demo/pdist/RCSProxy.py +++ b/Demo/pdist/RCSProxy.py @@ -188,7 +188,7 @@ def test(): if callable(attr): print apply(attr, tuple(sys.argv[2:])) else: - print `attr` + print repr(attr) else: print "%s: no such attribute" % what sys.exit(2) diff --git a/Demo/pdist/client.py b/Demo/pdist/client.py index 3e93f1c..a00f005 100755 --- a/Demo/pdist/client.py +++ b/Demo/pdist/client.py @@ -139,7 +139,7 @@ class SecureClient(Client, Security): line = self._rf.readline() challenge = string.atoi(string.strip(line)) response = self._encode_challenge(challenge) - line = `long(response)` + line = repr(long(response)) if line[-1] in 'Ll': line = line[:-1] self._wf.write(line + '\n') self._wf.flush() diff --git a/Demo/pdist/cmdfw.py b/Demo/pdist/cmdfw.py index a0c6f5d..25584b7 100755 --- a/Demo/pdist/cmdfw.py +++ b/Demo/pdist/cmdfw.py @@ -55,7 +55,7 @@ class CommandFrameWork: try: method = getattr(self, mname) except AttributeError: - return self.usage("command %s unknown" % `cmd`) + return self.usage("command %r unknown" % (cmd,)) try: flags = getattr(self, fname) except AttributeError: @@ -75,7 +75,7 @@ class CommandFrameWork: print "-"*40 print "Options:" for o, a in opts: - print 'option', o, 'value', `a` + print 'option', o, 'value', repr(a) print "-"*40 def ready(self): @@ -137,7 +137,7 @@ def test(): for t in tests: print '-'*10, t, '-'*10 sts = x.run(t) - print "Exit status:", `sts` + print "Exit status:", repr(sts) if __name__ == '__main__': diff --git a/Demo/pdist/cmptree.py b/Demo/pdist/cmptree.py index 7eaa6c3..8a34f3f 100755 --- a/Demo/pdist/cmptree.py +++ b/Demo/pdist/cmptree.py @@ -49,7 +49,7 @@ def askint(prompt, default): def compare(local, remote, mode): print - print "PWD =", `os.getcwd()` + print "PWD =", repr(os.getcwd()) sums_id = remote._send('sumlist') subdirs_id = remote._send('listsubdirs') remote._flush() @@ -64,13 +64,13 @@ def compare(local, remote, mode): for name, rsum in sums: rsumdict[name] = rsum if not lsumdict.has_key(name): - print `name`, "only remote" + print repr(name), "only remote" if 'r' in mode and 'c' in mode: recvfile(local, remote, name) else: lsum = lsumdict[name] if lsum != rsum: - print `name`, + print repr(name), rmtime = remote.mtime(name) lmtime = local.mtime(name) if rmtime > lmtime: @@ -86,7 +86,7 @@ def compare(local, remote, mode): print for name in lsumdict.keys(): if not rsumdict.keys(): - print `name`, "only locally", + print repr(name), "only locally", fl() if 'w' in mode and 'c' in mode: sendfile(local, remote, name) @@ -160,7 +160,7 @@ def recvfile(local, remote, name): return rv finally: if not ok: - print "*** recvfile of %s failed, deleting" % `name` + print "*** recvfile of %r failed, deleting" % (name,) local.delete(name) def recvfile_real(local, remote, name): diff --git a/Demo/pdist/cvslock.py b/Demo/pdist/cvslock.py index a421e1a..75f866e 100755 --- a/Demo/pdist/cvslock.py +++ b/Demo/pdist/cvslock.py @@ -114,7 +114,7 @@ class Lock: self.delay = delay self.lockdir = None self.lockfile = None - pid = `os.getpid()` + pid = repr(os.getpid()) self.cvslck = self.join(CVSLCK) self.cvsrfl = self.join(CVSRFL + pid) self.cvswfl = self.join(CVSWFL + pid) diff --git a/Demo/pdist/rcslib.py b/Demo/pdist/rcslib.py index 4e72766..78de111 100755 --- a/Demo/pdist/rcslib.py +++ b/Demo/pdist/rcslib.py @@ -232,7 +232,7 @@ class RCS: """ name, rev = self._unmangle(name_rev) if not self.isvalid(name): - raise os.error, 'not an rcs file %s' % `name` + raise os.error, 'not an rcs file %r' % (name,) return name, rev # --- Internal methods --- @@ -252,7 +252,7 @@ class RCS: namev = self.rcsname(name) if rev: cmd = cmd + ' ' + rflag + rev - return os.popen("%s %s" % (cmd, `namev`)) + return os.popen("%s %r" % (cmd, namev)) def _unmangle(self, name_rev): """INTERNAL: Normalize NAME_REV argument to (NAME, REV) tuple. diff --git a/Demo/pdist/server.py b/Demo/pdist/server.py index 423d583..4e4ab0d 100755 --- a/Demo/pdist/server.py +++ b/Demo/pdist/server.py @@ -134,11 +134,11 @@ class SecureServer(Server, Security): response = string.atol(string.strip(response)) except string.atol_error: if self._verbose > 0: - print "Invalid response syntax", `response` + print "Invalid response syntax", repr(response) return 0 if not self._compare_challenge_response(challenge, response): if self._verbose > 0: - print "Invalid response value", `response` + print "Invalid response value", repr(response) return 0 if self._verbose > 1: print "Response matches challenge. Go ahead!" |