Browse Source

Work towards Python 3 support

Clara Hobbs 8 years ago
parent
commit
980c6c4c05
2 changed files with 4 additions and 4 deletions
  1. 1
    1
      blather.py
  2. 3
    3
      gtkui.py

+ 1
- 1
blather.py View File

@@ -180,7 +180,7 @@ class Blather:
180 180
     def recognizer_finished(self, recognizer, text):
181 181
         t = text.lower()
182 182
         # Is there a matching command?
183
-        if self.commands.has_key( t ):
183
+        if t in self.commands:
184 184
             # Run the valid_sentence_command if there is a valid sentence command
185 185
             if self.options['valid_sentence_command']:
186 186
                 subprocess.call(self.options['valid_sentence_command'], shell=True)

+ 3
- 3
gtkui.py View File

@@ -13,7 +13,7 @@ class UI(GObject.GObject):
13 13
         'command' : (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_STRING,))
14 14
     }
15 15
 
16
-    def __init__(self,args, continuous):
16
+    def __init__(self, args, continuous):
17 17
         GObject.GObject.__init__(self)
18 18
         self.continuous = continuous
19 19
         # Make a window
@@ -33,8 +33,8 @@ class UI(GObject.GObject):
33 33
         layout.add(self.ccheckbox)
34 34
 
35 35
         # Connect the buttons
36
-        self.lsbutton.connect("clicked",self.lsbutton_clicked)
37
-        self.ccheckbox.connect("clicked",self.ccheckbox_clicked)
36
+        self.lsbutton.connect("clicked", self.lsbutton_clicked)
37
+        self.ccheckbox.connect("clicked", self.ccheckbox_clicked)
38 38
 
39 39
         # Add a label to the UI to display the last command
40 40
         self.label = Gtk.Label()

Loading…
Cancel
Save