diff --git a/pysplit/client/curses_timer.py b/pysplit/client/curses_timer.py index c103001..6fde6db 100644 --- a/pysplit/client/curses_timer.py +++ b/pysplit/client/curses_timer.py @@ -3,12 +3,13 @@ import signal import datetime import traceback +from functools import partial from time import sleep from os.path import isfile -from threading import Thread -from subprocess import check_call from pysplit.client import records from pysplit.config import cfg +from multiprocessing import Process +from playsound import playsound def now(): @@ -213,9 +214,8 @@ def print(self, string): @staticmethod def play_sound(sound_file): - if isfile(sound_file): - t = Thread(target=check_call, args=(['afplay', sound_file],)) - t.start() + if sound_file and isfile(sound_file): + Process(target=partial(playsound, sound_file)).start() class Descriptor: diff --git a/setup.py b/setup.py index 5d22f05..4f46a4e 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,8 @@ name='PySplit', version=pysplit.__version__, packages=['pysplit', 'pysplit.client'], + install_requires=['requests>=2.20.0', 'PyYAML>=5.3.1', + 'Flask>=1.1.2', 'tornado>=5.1', 'playsound>=1.2'], entry_points={ 'console_scripts': ['pysplit = pysplit.runner:main'] }