From 191bb9843e48154f8c616a9b81f49cc4c3b4f13d Mon Sep 17 00:00:00 2001 From: Constantin Date: Tue, 16 Oct 2012 23:47:01 +0200 Subject: [PATCH] fixed some bugs in the experimental zenity code --- zenity_dialogue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]) -- 2.30.2