From 2b1e8411ab5eaa7e1349b78d03270ab02ae2950d Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 6 Oct 2014 16:52:53 +0200 Subject: Fix flake8 style nits --- client/conversation.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'client/conversation.py') 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: -- cgit v1.3.1