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@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)
On Wed, 2013-02-06 at 14:53 +0000, Chris Lumens wrote:
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.
Looks good.
There's all sorts of stuff hidden in those overrides.
Yeah and this was the reason why I even sent this patch for a review.
anaconda-patches@lists.fedorahosted.org