summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-12-04 17:30:08 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2014-12-04 17:30:08 +0100
commit0c55a8e7e3eada51d24c7bc74446ecf9c255505d (patch)
tree052413d8d87d5dd8a72c7794b9424971b67c0dc5
parent68e5c979ad6f643af23a8c1e5895c8bb38527328 (diff)
parent631d6841a96db0b50fd2ebd2d23dc669fe30afee (diff)
downloadjasper-client-0c55a8e7e3eada51d24c7bc74446ecf9c255505d.tar.gz
jasper-client-0c55a8e7e3eada51d24c7bc74446ecf9c255505d.zip
Merge pull request #259 from Holzhaus/print-overhaul
Print overhaul
-rw-r--r--client/local_mic.py2
-rw-r--r--client/modules/MPDControl.py6
-rw-r--r--client/stt.py18
-rw-r--r--client/vocabcompiler.py2
-rwxr-xr-xjasper.py9
5 files changed, 18 insertions, 19 deletions
diff --git a/client/local_mic.py b/client/local_mic.py
index a58370d..5c0fed2 100644
--- a/client/local_mic.py
+++ b/client/local_mic.py
@@ -29,4 +29,4 @@ class Mic:
return input
def say(self, phrase, OPTIONS=None):
- print "JASPER: " + phrase
+ print("JASPER: %s" % phrase)
diff --git a/client/modules/MPDControl.py b/client/modules/MPDControl.py
index 2548237..ee0904b 100644
--- a/client/modules/MPDControl.py
+++ b/client/modules/MPDControl.py
@@ -131,10 +131,10 @@ class MusicMode(object):
# self.mic.say("Found songs")
# self.music.play(songs = songs)
- # print "SONG RESULTS"
- # print "============"
+ # print("SONG RESULTS")
+ # print("============")
# for song in songs:
- # print "Song: %s Artist: %s" % (song.title, song.artist)
+ # print("Song: %s Artist: %s" % (song.title, song.artist))
# self.mic.say("Playing %s" % self.music.current_song())
diff --git a/client/stt.py b/client/stt.py
index 543a322..86cc83b 100644
--- a/client/stt.py
+++ b/client/stt.py
@@ -138,11 +138,9 @@ class PocketSphinxSTT(AbstractSTTEngine):
self._logger.debug(line.strip())
f.truncate()
- print "==================="
- print "JASPER: " + result[0]
- print "==================="
-
- return [result[0]]
+ transcribed = [result[0]]
+ self._logger.info('Transcribed: %r', transcribed)
+ return transcribed
@classmethod
def is_available(cls):
@@ -396,11 +394,11 @@ class AttSTT(AbstractSTTEngine):
exc_info=True)
return []
else:
- results = [x[0].upper() for x in sorted(results,
- key=lambda x: x[1],
- reverse=True)]
- self._logger.info('Recognized: %r', results)
- return results
+ transcribed = [x[0].upper() for x in sorted(results,
+ key=lambda x: x[1],
+ reverse=True)]
+ self._logger.info('Transcribed: %r', transcribed)
+ return transcribed
def _get_response(self, data):
headers = {'authorization': 'Bearer %s' % self.token,
diff --git a/client/vocabcompiler.py b/client/vocabcompiler.py
index 0fb668a..ed9f425 100644
--- a/client/vocabcompiler.py
+++ b/client/vocabcompiler.py
@@ -388,7 +388,7 @@ if __name__ == '__main__':
base_dir = args.base_dir if args.base_dir else tempfile.mkdtemp()
phrases = get_all_phrases()
- print "Module phrases: %r" % phrases
+ print("Module phrases: %r" % phrases)
for subclass in AbstractVocabulary.__subclasses__():
if hasattr(subclass, 'PATH_PREFIX'):
diff --git a/jasper.py b/jasper.py
index dbb1c08..1a61981 100755
--- a/jasper.py
+++ b/jasper.py
@@ -113,13 +113,14 @@ class Jasper(object):
if __name__ == "__main__":
- print "==========================================================="
- print " JASPER The Talking Computer "
- print " Copyright 2013 Shubhro Saha & Charlie Marsh "
- print "==========================================================="
+ print("===========================================================")
+ print(" JASPER The Talking Computer ")
+ print(" Copyright 2013 Shubhro Saha & Charlie Marsh ")
+ print("===========================================================")
logging.basicConfig()
logger = logging.getLogger()
+ logger.getChild("client.stt").setLevel(logging.INFO)
if args.debug:
logger.setLevel(logging.DEBUG)