From: Constantin Date: Tue, 16 Oct 2012 21:47:01 +0000 (+0200) Subject: fixed some bugs in the experimental zenity code X-Git-Url: https://git.ralfj.de/lilass.git/commitdiff_plain/191bb9843e48154f8c616a9b81f49cc4c3b4f13d?ds=inline;hp=--cc fixed some bugs in the experimental zenity code --- 191bb9843e48154f8c616a9b81f49cc4c3b4f13d 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])