Skip to content

Commit

Permalink
Add audio check feature
Browse files Browse the repository at this point in the history
  • Loading branch information
JaDogg committed Jul 10, 2020
1 parent 3b2ff4d commit 89dc991
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion make_exe.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
pyinstaller pydoro\pydoro_tui.py --onefile --icon images\Tomato.ico --add-data ".\pydoro\pydoro_core\b15.wav;."
pyinstaller pydoro\pydoro_tui.py --onefile --icon images\Tomato.ico --add-data ".\pydoro\pydoro_core\b15.wav;." --add-data ".\.venv\Lib\site-packages\wcwidth;wcwidth"
2 changes: 2 additions & 0 deletions pydoro/pydoro_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def _cli_parse(self):
)
parser.add_argument("--no-clock", help="hides clock", action="store_true")
parser.add_argument("--no-sound", help="mutes all sounds", action="store_true")
parser.add_argument("--audio-check", help="play audio and exit", action="store_true")
self.cli_args = parser.parse_args()

def _ini_parse(self):
Expand Down Expand Up @@ -107,3 +108,4 @@ def _cli_load(self):
self.no_clock = self.cli_args.no_clock or self.cli_args.focus or self.no_clock
self.no_sound = self.cli_args.no_sound or self.cli_args.focus or self.no_sound
self.emoji = self.cli_args.emoji or self.emoji
self.audio_check = self.cli_args.audio_check
10 changes: 8 additions & 2 deletions pydoro/pydoro_tui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
import sys
import threading

from prompt_toolkit.application import Application
Expand All @@ -11,7 +12,8 @@

from pydoro.pydoro_core.config import Configuration
from pydoro.pydoro_core.tomato import Tomato
from pydoro.pydoro_core.util import every
from pydoro.pydoro_core.util import every, in_app_path
import pydoro.pydoro_core.sound as sound


class UserInterface:
Expand Down Expand Up @@ -118,7 +120,11 @@ def run(self):


def main():
UserInterface(Configuration()).run()
config = Configuration()
if config.audio_check:
sound.play(in_app_path("b15.wav"), block=True)
sys.exit(0)
UserInterface(config).run()


if __name__ == "__main__":
Expand Down

0 comments on commit 89dc991

Please sign in to comment.