X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=0b16695befb639a8b25a4d298f6f689db974bed0;hb=da23930cdbb8de7d77ac2df4f526557d4983bd53;hp=f262e6dd989f19dc2ab6c6390092dfff4a65740b;hpb=65f956533b9d3e4ecab1b5816a9f6afdcf190b0d;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index f262e6d..0b16695 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) @@ -108,7 +112,8 @@ class AutorandrException(Exception): retval.append(":\n ") retval.append(str(self.original_exception).replace("\n", "\n ")) if self.report_bug: - retval.append("\nThis appears to be a bug. Please help improving autorandr by reporting it upstream." + retval.append("\nThis appears to be a bug. Please help improving autorandr by reporting it upstream:" + "\nhttps://github.com/phillipberndt/autorandr/issues" "\nPlease attach the output of `xrandr --verbose` to your bug report if appropriate.") return "".join(retval) @@ -807,7 +812,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 @@ -894,6 +899,9 @@ def main(argv): "PROFILE_FOLDER": scripts_path, } exec_scripts(scripts_path, "preswitch", script_metadata) + if "--debug" in options: + print("Going to run:") + apply_configuration(load_config, config, True) apply_configuration(load_config, config, False) exec_scripts(scripts_path, "postswitch", script_metadata) except Exception as e: @@ -918,5 +926,5 @@ if __name__ == '__main__': print("Exception: {0}".format(e.__class__.__name__)) sys.exit(2) - print("Unhandled exception ({0}). Please report this as a bug.".format(e), file=sys.stderr) + print("Unhandled exception ({0}). Please report this as a bug at https://github.com/phillipberndt/autorandr/issues.".format(e), file=sys.stderr) raise