Browse Source

Minor formatting improvements

Clara Hobbs 8 years ago
parent
commit
443883b689
2 changed files with 6 additions and 6 deletions
  1. 4
    4
      blather.py
  2. 2
    2
      recognizer.py

+ 4
- 4
blather.py View File

@@ -106,7 +106,7 @@ class Blather:
106 106
                 (key, value) = line.split(":", 1)
107 107
                 print(key, value)
108 108
                 self.commands[key.strip().lower()] = value.strip()
109
-                strings.write( key.strip()+"\n")
109
+                strings.write(key.strip() + "\n")
110 110
         # Close the strings file
111 111
         strings.close()
112 112
 
@@ -127,7 +127,7 @@ class Blather:
127 127
             # Open and truncate the blather history file
128 128
             hfile = open(history_file, "w")
129 129
             for line in self.history:
130
-                hfile.write( line+"\n")
130
+                hfile.write(line + "\n")
131 131
             # Close the file
132 132
             hfile.close()
133 133
 
@@ -221,7 +221,7 @@ class Blather:
221 221
         paths = ["/usr/share/blather/", "/usr/local/share/blather", local_data]
222 222
         for path in paths:
223 223
             resource = os.path.join(path, string)
224
-            if os.path.exists( resource ):
224
+            if os.path.exists(resource):
225 225
                 return resource
226 226
         # If we get this far, no resource was found
227 227
         return False
@@ -253,7 +253,7 @@ if __name__ == "__main__":
253 253
             action='store',
254 254
             help="command to run when a valid sentence is detected")
255 255
 
256
-    parser.add_argument( "--invalid-sentence-command",  type=str, dest="invalid_sentence_command",
256
+    parser.add_argument("--invalid-sentence-command",  type=str, dest="invalid_sentence_command",
257 257
             action='store',
258 258
             help="command to run when an invalid sentence is detected")
259 259
 

+ 2
- 2
recognizer.py View File

@@ -12,7 +12,7 @@ import os.path
12 12
 import sys
13 13
 
14 14
 # Define some global variables
15
-this_dir = os.path.dirname( os.path.abspath(__file__) )
15
+this_dir = os.path.dirname(os.path.abspath(__file__))
16 16
 
17 17
 
18 18
 class Recognizer(GObject.GObject):
@@ -31,7 +31,7 @@ class Recognizer(GObject.GObject):
31 31
         # Build the pipeline
32 32
         cmd = audio_src + ' ! audioconvert ! audioresample ! pocketsphinx name=asr ! appsink sync=false'
33 33
         try:
34
-            self.pipeline = Gst.parse_launch( cmd )
34
+            self.pipeline = Gst.parse_launch(cmd)
35 35
         except Exception as e:
36 36
             print(e.message)
37 37
             print("You may need to install gstreamer1.0-pocketsphinx")

Loading…
Cancel
Save