From 602633373e9f83df225aec881e8522071a899c60 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Mon, 28 Jan 2019 17:26:48 +0100 Subject: [PATCH] Test version --- hugvey/story.py | 6 ++++-- hugvey/voice/player.py | 1 + local | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hugvey/story.py b/hugvey/story.py index 48402bd..04398ac 100644 --- a/hugvey/story.py +++ b/hugvey/story.py @@ -1,6 +1,7 @@ import json import time import logging +import re import asyncio @@ -83,7 +84,7 @@ class Condition(object): if not story.lastMsgFinishTime: return False - return now - story.lastMsgFinishTime >= self.vars['seconds'] + return now - story.lastMsgFinishTime >= float(self.vars['seconds']) def _hasMetReplyContains(self, story): if not story.currentMessage.hasReply(): @@ -93,13 +94,14 @@ class Condition(object): if 'regexCompiled' not in self.vars: # Compile once, as we probably run it more than once self.vars['regexCompiled'] = re.compile(self.vars['regex']) - result = re.match(self.vars['regexCompiled']) + result = re.match(self.vars['regexCompiled'], story.currentMessage.getReply()) if result is None: return False results = result.groupdict() for captureGroup in results: story.variables[captureGroup] = results[captureGroup] logger.critical("Regex not implemented yet") +# return True return False if 'contains' in self.vars: diff --git a/hugvey/voice/player.py b/hugvey/voice/player.py index e10cab3..83b530a 100644 --- a/hugvey/voice/player.py +++ b/hugvey/voice/player.py @@ -33,6 +33,7 @@ class Player: def get_output_idx(self): output_device_idx = None + output_device_idx = 14 devices_count = self.p.get_device_count() for i in range(devices_count): dev = self.p.get_device_info_by_index(i) diff --git a/local b/local index 71d7b7e..e799809 160000 --- a/local +++ b/local @@ -1 +1 @@ -Subproject commit 71d7b7e1d6a4f4cb1503b845ebb44c4357d42180 +Subproject commit e799809a59522d0f68f99f668a9ddf0f5f629912