summaryrefslogtreecommitdiffstats
path: root/git-interface/aurinfo.py
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-06-27 12:27:07 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-06-27 13:04:03 +0200
commitae2907a57ec50bba2c74d4ce1d137fe822fddf3b (patch)
treedd928afcc568103b64d893d55defaec5cc051618 /git-interface/aurinfo.py
parent226376fc6296aec6b5dbbc52a7fda69a2a6fce87 (diff)
downloadaur-ae2907a57ec50bba2c74d4ce1d137fe822fddf3b.tar.gz
aur-ae2907a57ec50bba2c74d4ce1d137fe822fddf3b.tar.xz
git: Use .format everywhere instead of %
% formatting is deprecated, and .format should be used instead. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface/aurinfo.py')
-rw-r--r--git-interface/aurinfo.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/git-interface/aurinfo.py b/git-interface/aurinfo.py
index 86d07050..201f8642 100644
--- a/git-interface/aurinfo.py
+++ b/git-interface/aurinfo.py
@@ -84,7 +84,7 @@ class AurInfo(object):
class StderrECatcher(object):
def Catch(self, lineno, error):
- print('ERROR[%d]: %s' % (lineno, error), file=sys.stderr)
+ print('ERROR[{:d}]: {:s}'.format(lineno, error), file=sys.stderr)
class CollectionECatcher(object):
@@ -126,8 +126,8 @@ def ParseAurinfoFromIterable(iterable, ecatcher=None):
try:
key, value = map(str.strip, line.split('=', 1))
except ValueError:
- ecatcher.Catch(lineno, 'unexpected header format in section=%s' %
- current_package['pkgname'])
+ ecatcher.Catch(lineno, 'unexpected header format in section={:s}'.format(
+ current_package['pkgname']))
continue
if key == 'pkgbase':
@@ -149,7 +149,7 @@ def ParseAurinfoFromIterable(iterable, ecatcher=None):
key, value = map(str.strip, line.split('=', 1))
except ValueError:
ecatcher.Catch(lineno, 'unexpected attribute format in '
- 'section=%s' % current_package['pkgname'])
+ 'section={:s}'.format(current_package['pkgname']))
if IsMultiValued(key):
if not current_package.get(key):
@@ -161,8 +161,8 @@ def ParseAurinfoFromIterable(iterable, ecatcher=None):
current_package[key] = value
else:
ecatcher.Catch(lineno, 'overwriting attribute '
- '%s: %s -> %s' % (key, current_package[key],
- value))
+ '{:s}: {:s} -> {:s}'.format(key,
+ current_package[key], value))
return aurinfo
@@ -177,7 +177,7 @@ def ValidateAurinfo(filename='.AURINFO'):
ParseAurinfo(filename, ecatcher)
errors = ecatcher.Errors()
for error in errors:
- print('error on line %d: %s' % error, file=sys.stderr)
+ print('error on line {:d}: {:s}'.format(error), file=sys.stderr)
return not errors
@@ -196,13 +196,13 @@ if __name__ == '__main__':
if action == 'parse':
aurinfo = ParseAurinfo()
for pkgname in aurinfo.GetPackageNames():
- print(">>> merged package: %s" % pkgname)
+ print(">>> merged package: {:s}".format(pkgname))
pp.pprint(aurinfo.GetMergedPackage(pkgname))
print()
elif action == 'validate':
sys.exit(not ValidateAurinfo(filename))
else:
- print('unknown action: %s' % action)
+ print('unknown action: {:s}'.format(action))
sys.exit(1)
# vim: set et ts=4 sw=4: