aboutsummaryrefslogtreecommitdiff
path: root/ghwt.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-03-04 17:16:11 -0500
committerEli Schwartz <eschwartz@archlinux.org>2021-03-04 17:16:11 -0500
commit6a0fabc6472f49621260de215f128a31ae70219b (patch)
tree6a67908358a2c5e5baa215fe0201dfe213dd8a01 /ghwt.py
parent4340bf34faca7eed8076ba4c388fbe15355f2183 (diff)
downloadmeson-6a0fabc6472f49621260de215f128a31ae70219b.zip
meson-6a0fabc6472f49621260de215f128a31ae70219b.tar.gz
meson-6a0fabc6472f49621260de215f128a31ae70219b.tar.bz2
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
Diffstat (limited to 'ghwt.py')
-rwxr-xr-xghwt.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ghwt.py b/ghwt.py
index 5a71a38..6f9373b 100755
--- a/ghwt.py
+++ b/ghwt.py
@@ -43,7 +43,7 @@ def list_projects():
def unpack(sproj, branch):
tmpdir = os.path.join(spdir, sproj + '_ghwt')
shutil.rmtree(tmpdir, ignore_errors=True)
- subprocess.check_call(['git', 'clone', '-b', branch, 'https://github.com/mesonbuild/{}.git'.format(sproj), tmpdir])
+ subprocess.check_call(['git', 'clone', '-b', branch, f'https://github.com/mesonbuild/{sproj}.git', tmpdir])
usfile = os.path.join(tmpdir, 'upstream.wrap')
assert(os.path.isfile(usfile))
config = configparser.ConfigParser(interpolation=None)
@@ -52,7 +52,7 @@ def unpack(sproj, branch):
if 'directory' in config['wrap-file']:
outdir = os.path.join(spdir, config['wrap-file']['directory'])
if os.path.isdir(outdir):
- print('Subproject is already there. To update, nuke the {} dir and reinstall.'.format(outdir))
+ print(f'Subproject is already there. To update, nuke the {outdir} dir and reinstall.')
shutil.rmtree(tmpdir)
return 1
us_url = config['wrap-file']['source_url']
@@ -85,7 +85,7 @@ def install(sproj, requested_branch=None):
if not os.path.isdir(spdir):
print('Run this in your source root and make sure there is a subprojects directory in it.')
return 1
- blist = gh_get('https://api.github.com/repos/mesonbuild/{}/branches'.format(sproj))
+ blist = gh_get(f'https://api.github.com/repos/mesonbuild/{sproj}/branches')
blist = [b['name'] for b in blist]
blist = [b for b in blist if b != 'master']
blist.sort()