From: kaliko Date: Sat, 20 Nov 2021 08:49:28 +0000 (+0100) Subject: Update venv installer X-Git-Tag: 0.18.1~27 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=f061c9cf09cd7834bfa4f7bc27321528a81e0b26;p=mpd-sima.git Update venv installer Require python 3.6 --- diff --git a/vinstall.py b/vinstall.py index 102d8cd..afbb0e3 100755 --- a/vinstall.py +++ b/vinstall.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 # Copyright (C) 2013 Vinay Sajip. New BSD License. -# Copyright (C) 2014, 2020 kaliko +# Copyright (C) 2014, 2021 kaliko # -REQ_VER = (3,4) +REQ_VER = (3,6) import sys if sys.version_info < REQ_VER: print('Need at least python {0}.{1} to run this script'.format(*REQ_VER), file=sys.stderr) @@ -91,7 +91,7 @@ class ExtendedEnvBuilder(venv.EnvBuilder): os.unlink(distpath) -def main(args=None): +def main(): root = os.path.dirname(os.path.abspath(__file__)) vdir = os.path.join(root, 'venv') builder = ExtendedEnvBuilder(clear=True, verbose=False, with_pip=True) @@ -103,8 +103,8 @@ def main(args=None): # Write wrapper with open(os.path.join(root, 'vmpd-sima'),'w') as fd: fd.write('#!/bin/sh\n') - fd.write('. "{}/venv/bin/activate"\n'.format(root)) - fd.write('"{}/venv/bin/mpd-sima" "$@"'.format(root)) + fd.write(f'. "{root}/venv/bin/activate"\n') + fd.write(f'"{root}/venv/bin/mpd-sima" "$@"') os.chmod(os.path.join(root, 'vmpd-sima'), 0o744) @@ -114,5 +114,5 @@ if __name__ == '__main__': main() rc = 0 except ImportError as e: - print('Error: %s' % e) + print(f'Error: {e}') sys.exit(rc)