Module: deluge
Branch: 1.3-stable
Commit: 254efa88e593634ad9b1109d1380133242763882

Author: Calum Lind <[email protected]>
Date:   Sun May 29 12:08:55 2011 +0100

Add check to key_press_event for keyname returning None

---

 deluge/ui/gtkui/files_tab.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py
index 53db593..51330ce 100644
--- a/deluge/ui/gtkui/files_tab.py
+++ b/deluge/ui/gtkui/files_tab.py
@@ -522,12 +522,11 @@ class FilesTab(Tab):
 
     def _on_key_press_event(self, widget, event):
         keyname = gtk.gdk.keyval_name(event.keyval)
-        func = getattr(self, 'keypress_' + keyname, None)
-        selected_rows = self.listview.get_selection().get_selected_rows()[1]
-        if func and selected_rows:
-            return func(event)
-        else:
-            return
+        if keyname is not None:
+            func = getattr(self, 'keypress_' + keyname, None)
+            selected_rows = 
self.listview.get_selection().get_selected_rows()[1]
+            if func and selected_rows:
+                return func(event)
 
     def keypress_Menu(self, event):
         self.file_menu.popup(None, None, None, 3, event.time)

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to