summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHugo <hugovk@users.noreply.github.com>2018-09-06 14:18:29 +0300
committerHugo <hugovk@users.noreply.github.com>2018-09-06 14:18:29 +0300
commit368835bdf581467b0d7324eda0effc6ca09e618e (patch)
tree24fca8c7ede7aec00527da1b13d72e67412e240c /examples
parent4b03ff04068779d44155b5268e96b14ce0a390cf (diff)
downloaddnspython-368835bdf581467b0d7324eda0effc6ca09e618e.tar.gz
Upgrade Python syntax with pyupgrade https://github.com/asottile/pyupgrade
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/zonediff.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/zonediff.py b/examples/zonediff.py
index bfe4ee3..b65f828 100755
--- a/examples/zonediff.py
+++ b/examples/zonediff.py
@@ -101,7 +101,7 @@ def format_changes_plain(oldf, # type: str
Given 2 filenames and a list of changes from diff_zones, produce diff-like
output. If ignore_ttl is True, TTL-only changes are not displayed"""
- ret = "--- %s\n+++ %s\n" % (oldf, newf)
+ ret = "--- {}\n+++ {}\n".format(oldf, newf)
for name, old, new in changes:
ret += "@ %s\n" % name
if not old:
@@ -244,34 +244,34 @@ The differences shown will be logical differences, not textual differences.
else:
if len(args) == 3:
filename, oldr, newr = args
- oldn = "%s:%s" % (oldr, filename)
- newn = "%s:%s" % (newr, filename)
+ oldn = "{}:{}".format(oldr, filename)
+ newn = "{}:{}".format(newr, filename)
else:
filename, oldr = args
newr = None
- oldn = "%s:%s" % (oldr, filename)
+ oldn = "{}:{}".format(oldr, filename)
newn = filename
old, new = None, None
oldz, newz = None, None
if opts.use_bzr:
old = _open(["bzr", "cat", "-r" + oldr, filename],
- "Unable to retrieve revision %s of %s" % (oldr, filename))
+ "Unable to retrieve revision {} of {}".format(oldr, filename))
if newr is not None:
new = _open(["bzr", "cat", "-r" + newr, filename],
- "Unable to retrieve revision %s of %s" % (newr, filename))
+ "Unable to retrieve revision {} of {}".format(newr, filename))
elif opts.use_git:
old = _open(["git", "show", oldn],
- "Unable to retrieve revision %s of %s" % (oldr, filename))
+ "Unable to retrieve revision {} of {}".format(oldr, filename))
if newr is not None:
new = _open(["git", "show", newn],
- "Unable to retrieve revision %s of %s" % (newr, filename))
+ "Unable to retrieve revision {} of {}".format(newr, filename))
elif opts.use_rcs:
old = _open(["co", "-q", "-p", "-r" + oldr, filename],
- "Unable to retrieve revision %s of %s" % (oldr, filename))
+ "Unable to retrieve revision {} of {}".format(oldr, filename))
if newr is not None:
new = _open(["co", "-q", "-p", "-r" + newr, filename],
- "Unable to retrieve revision %s of %s" % (newr, filename))
+ "Unable to retrieve revision {} of {}".format(newr, filename))
if not opts.use_vc:
old = _open(oldn, "Unable to open %s" % oldn)
if not opts.use_vc or newr is None: