summaryrefslogtreecommitdiff
path: root/client/conversation.py
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-10-06 16:52:53 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-10-06 16:52:53 +0200
commit2b1e8411ab5eaa7e1349b78d03270ab02ae2950d (patch)
treeed914cbf8964bbe26ba28e80589f4c289b3fac3a /client/conversation.py
parent890a5798fcf7f9b9dc06529aa4bc7fe903d7ca1a (diff)
downloadjasper-client-2b1e8411ab5eaa7e1349b78d03270ab02ae2950d.tar.gz
jasper-client-2b1e8411ab5eaa7e1349b78d03270ab02ae2950d.zip
Fix flake8 style nits
Diffstat (limited to 'client/conversation.py')
-rw-r--r--client/conversation.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/client/conversation.py b/client/conversation.py
index 9b86295..6b2fab1 100644
--- a/client/conversation.py
+++ b/client/conversation.py
@@ -3,6 +3,7 @@ import logging
from notifier import Notifier
from brain import Brain
+
class Conversation(object):
def __init__(self, persona, mic, profile):
@@ -14,27 +15,34 @@ class Conversation(object):
self.notifier = Notifier(profile)
def handleForever(self):
- """Delegates user input to the handling function when activated."""
- self._logger.info("Starting to handle conversation with keyword '%s'.", self.persona)
+ """
+ Delegates user input to the handling function when activated.
+ """
+ self._logger.info("Starting to handle conversation with keyword '%s'.",
+ self.persona)
while True:
# Print notifications until empty
notifications = self.notifier.getAllNotifications()
for notif in notifications:
self._logger.info("Received notification: '%s'", str(notif))
- self._logger.debug("Started listening for keyword '%s'", self.persona)
+ self._logger.debug("Started listening for keyword '%s'",
+ self.persona)
threshold, transcribed = self.mic.passiveListen(self.persona)
- self._logger.debug("Stopped listening for keyword '%s'", self.persona)
+ self._logger.debug("Stopped listening for keyword '%s'",
+ self.persona)
if not transcribed or not threshold:
self._logger.info("Nothing has been said or transcribed.")
continue
self._logger.info("Keyword '%s' has been said!", self.persona)
- self._logger.debug("Started to listen actively with threshold: %r", threshold)
+ self._logger.debug("Started to listen actively with threshold: %r",
+ threshold)
input = self.mic.activeListenToAllOptions(threshold)
- self._logger.debug("Stopped to listen actively with threshold: %r", threshold)
-
+ self._logger.debug("Stopped to listen actively with threshold: %r",
+ threshold)
+
if input:
self.brain.query(input)
else: