fixed some bugs in the experimental zenity code
[lilass.git] / zenity_dialogue.py
index 8cba4d9dff7b7dc351308b362c9baacc3e4c3a60..33f31778583f3349a7a2432e2c9d35d6d43d2bcc 100644 (file)
@@ -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])