Bugfix: don't switch to non-existing sections.

portnov [2008-08-27 07:56:24]
Bugfix: don't switch to non-existing sections.
Filename
qwerty.py
diff --git a/qwerty.py b/qwerty.py
index d4c45ef..e9ba5eb 100755
--- a/qwerty.py
+++ b/qwerty.py
@@ -591,6 +591,10 @@ class GUI(object):

         id = (int(k)-1)%10
 #         id = int(k)
+        try:
+            self.S = sections[int(k)]
+        except KeyError:
+            return
         defsection = id

         for b in self.sbuttons:
@@ -601,7 +605,6 @@ class GUI(object):
         for b in self.sbuttons:
             b.queue_draw()

-        self.S = sections[int(k)]
         for b in self.buttons:
             btn = self.buttons[b]
             btn.clear()
ViewGit