From: Simon Wydooghe Date: Mon, 28 Mar 2016 12:06:31 +0000 (+0200) Subject: Add python2 compatibility to removal ability X-Git-Tag: 1.0~26^2 X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fautorandr.git;a=commitdiff_plain;h=435f3158e6166a39a01bc8fc859920b7292234a7 Add python2 compatibility to removal ability --- diff --git a/autorandr.py b/autorandr.py index f262e6d..a65322d 100755 --- a/autorandr.py +++ b/autorandr.py @@ -40,6 +40,10 @@ from distutils.version import LooseVersion as Version from functools import reduce from itertools import chain +try: + input = raw_input +except NameError: + pass virtual_profiles = [ # (name, description, callback) @@ -807,7 +811,7 @@ def main(argv): profile_dirlist.remove("config") profile_dirlist.remove("setup") if profile_dirlist: - print("Profile folder '%s' contains the following:\n---\n%s\n---" % (options["--remove"], "\n".join(profile_dirlist))) + print("Profile folder '%s' contains the following additional files:\n---\n%s\n---" % (options["--remove"], "\n".join(profile_dirlist))) response = input("Do you really want to remove profile '%s'? If so, type 'yes': " % options["--remove"]).strip() if response != "yes": remove = False