From 63ba5a8dc2aa4ec3e6f203b0ba4db249ecf0b00e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 27 Jul 2016 21:33:09 +0200 Subject: Rename helpers to music_sampler --- helpers/actions/wait.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 helpers/actions/wait.py (limited to 'helpers/actions/wait.py') diff --git a/helpers/actions/wait.py b/helpers/actions/wait.py deleted file mode 100644 index ea42408..0000000 --- a/helpers/actions/wait.py +++ /dev/null @@ -1,40 +0,0 @@ -import threading - -def run(action, duration=0, music=None, set_wait_id=None, **kwargs): - if set_wait_id is not None: - action.mapping.add_wait_id(set_wait_id, action) - - action.sleep_event = threading.Event() - action.sleep_event_timer = threading.Timer( - duration, - action.sleep_event.set) - - if music is not None: - music.wait_end() - - action.sleep_event_timer.start() - action.sleep_event.wait() - -def description(action, duration=0, music=None, set_wait_id=None, **kwargs): - message = "" - if music is None: - message += "waiting {}s" \ - .format(duration) - elif duration == 0: - message += "waiting the end of « {} »" \ - .format(music.name) - else: - message += "waiting the end of « {} » + {}s" \ - .format(music.name, duration) - - if set_wait_id is not None: - message += " (setting id = {})".format(set_wait_id) - - return message - -def interrupt(action, duration=0, music=None, **kwargs): - if action.sleep_event is not None: - action.sleep_event.set() - action.sleep_event_timer.cancel() - if music is not None: - music.wait_event.set() -- cgit v1.2.3