summary refs log tree commit diff
diff options
context:
space:
mode:
authorJezra <jezra@jezra.net>2013-04-20 09:44:20 -0700
committerJezra <jezra@jezra.net>2013-04-20 09:44:20 -0700
commitabd0eacddb3f5ad44ad3e859e32826b4cd2fc8e4 (patch)
treeadb16211a4cab7abacb2eb8a996e3224c111be34
parenta14686b782b16740d9ee4a287efc4a5417ca1a9e (diff)
Whoa bub! you don't have to yell.
Case insensitive commands
-rwxr-xr-xBlather.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Blather.py b/Blather.py
index af36edb..8985cd6 100755
--- a/Blather.py
+++ b/Blather.py
@@ -51,16 +51,17 @@ class Blather:
 						#this is a parsible line
 						(key,value) = line.split(":",1)
 						print key, value
-						self.commands[key.strip()] = value.strip()
+						self.commands[key.strip().lower()] = value.strip()
 						strings.write( key.strip()+"\n")
 		#close the strings file
 		strings.close()
 	
 	
 	def recognizer_finished(self, recognizer, text):
+		t = text.lower()
 		#is there a matching command?
-		if self.commands.has_key( text ):
-			cmd = self.commands[text]
+		if self.commands.has_key( t ):
+			cmd = self.commands[t]
 			print cmd
 			subprocess.call(cmd, shell=True)
 		else:
@@ -71,7 +72,7 @@ class Blather:
 				#stop listening
 				self.recognizer.pause()
 			#let the UI know that there is a finish
-			self.ui.finished(text)
+			self.ui.finished(t)
 	
 	def run(self):
 		if self.ui: