X-Git-Url: https://git.ralfj.de/lilass.git/blobdiff_plain/33988e416bd971003f213d2bd04fc95104642ef8..191bb9843e48154f8c616a9b81f49cc4c3b4f13d:/zenity_dialogue.py diff --git a/zenity_dialogue.py b/zenity_dialogue.py index 8cba4d9..33f3177 100644 --- a/zenity_dialogue.py +++ b/zenity_dialogue.py @@ -21,9 +21,9 @@ from dsl import RelativeScreenPosition, ScreenSetup, res2user def userChoose (title, choices, returns): assert len(choices) == len(returns) p = subprocess.Popen(["zenity", "--list", "--text="+title, "--column="]+choices, stdout=subprocess.PIPE) - switch = zip (choices,returns) + switch = dict (zip (choices,returns)) for line in p.stdout: - return switch.get(line, None) + return switch.get(line.strip(), None) def run (internalResolutions, externalResolutions): relpos = userChoose ("Position of external screen", ["Left of internal screen", "Right of internal screen", "Use external screen only"], [RelativeScreenPosition.LEFT, RelativeScreenPosition.RIGHT, RelativeScreenPosition.EXTERNAL_ONLY])