[master] [PATCH] Overrides for the Gdk have _2BUTTON_PRESS defined

Vratislav Podzimek vpodzime at redhat.com
Wed Feb 6 10:46:28 UTC 2013


Gdk.EventType.2BUTTON_PRESS results in syntax error in Python.
However it is not necessary to use getattr() because there is
Gtk.EventType._2BUTTON_PRESS defined in Gdk's overrides.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/spokes/keyboard.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index 10ede4c..082702c 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -152,8 +152,7 @@ class AddLayoutDialog(GUIObject):
         self._entry.set_text("")
 
     def on_layout_view_button_press(self, widget, event, *args):
-        # BUG: Gdk.EventType.2BUTTON_PRESS results in syntax error
-        if event.type == getattr(Gdk.EventType, "2BUTTON_PRESS") and \
+        if event.type == Gdk.EventType._2BUTTON_PRESS and \
                 self._confirmAddButton.get_sensitive():
             # double-click should close the dialog if something is selected
             # (i.e. the Add button is sensitive)
-- 
1.7.11.7



More information about the anaconda-patches mailing list