Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, context):
"""
Create an instance of SafeEyesCore and initialize the variables.
"""
self.break_queue = None
self.postpone_duration = 0
self.default_postpone_duration = 0
self.pre_break_warning_time = 0
self.running = False
self.scheduled_next_break_timestamp = -1
self.scheduled_next_break_time = None
self.paused_time = -1
# This event is fired before for a break
self.on_pre_break = EventHook()
# This event is fired just before the start of a break
self.on_start_break = EventHook()
# This event is fired at the start of a break
self.start_break = EventHook()
# This event is fired during every count down
self.on_count_down = EventHook()
# This event is fired at the end of a break
self.on_stop_break = EventHook()
# This event is fired when deciding the next break time
self.on_update_next_break = EventHook()
self.waiting_condition = threading.Condition()
self.lock = threading.Lock()
self.context = context
self.context['skipped'] = False
self.context['postponed'] = False
self.context['state'] = State.WAITING
def __init__(self, context):
"""
Create an instance of SafeEyesCore and initialize the variables.
"""
self.break_queue = None
self.postpone_duration = 0
self.default_postpone_duration = 0
self.pre_break_warning_time = 0
self.running = False
self.scheduled_next_break_timestamp = -1
self.scheduled_next_break_time = None
self.paused_time = -1
# This event is fired before for a break
self.on_pre_break = EventHook()
# This event is fired just before the start of a break
self.on_start_break = EventHook()
# This event is fired at the start of a break
self.start_break = EventHook()
# This event is fired during every count down
self.on_count_down = EventHook()
# This event is fired at the end of a break
self.on_stop_break = EventHook()
# This event is fired when deciding the next break time
self.on_update_next_break = EventHook()
self.waiting_condition = threading.Condition()
self.lock = threading.Lock()
self.context = context
self.context['skipped'] = False
self.context['postponed'] = False
self.context['state'] = State.WAITING
self.break_queue = None
self.postpone_duration = 0
self.default_postpone_duration = 0
self.pre_break_warning_time = 0
self.running = False
self.scheduled_next_break_timestamp = -1
self.scheduled_next_break_time = None
self.paused_time = -1
# This event is fired before for a break
self.on_pre_break = EventHook()
# This event is fired just before the start of a break
self.on_start_break = EventHook()
# This event is fired at the start of a break
self.start_break = EventHook()
# This event is fired during every count down
self.on_count_down = EventHook()
# This event is fired at the end of a break
self.on_stop_break = EventHook()
# This event is fired when deciding the next break time
self.on_update_next_break = EventHook()
self.waiting_condition = threading.Condition()
self.lock = threading.Lock()
self.context = context
self.context['skipped'] = False
self.context['postponed'] = False
self.context['state'] = State.WAITING
Create an instance of SafeEyesCore and initialize the variables.
"""
self.break_queue = None
self.postpone_duration = 0
self.default_postpone_duration = 0
self.pre_break_warning_time = 0
self.running = False
self.scheduled_next_break_timestamp = -1
self.scheduled_next_break_time = None
self.paused_time = -1
# This event is fired before for a break
self.on_pre_break = EventHook()
# This event is fired just before the start of a break
self.on_start_break = EventHook()
# This event is fired at the start of a break
self.start_break = EventHook()
# This event is fired during every count down
self.on_count_down = EventHook()
# This event is fired at the end of a break
self.on_stop_break = EventHook()
# This event is fired when deciding the next break time
self.on_update_next_break = EventHook()
self.waiting_condition = threading.Condition()
self.lock = threading.Lock()
self.context = context
self.context['skipped'] = False
self.context['postponed'] = False
self.context['state'] = State.WAITING
self.running = False
self.scheduled_next_break_timestamp = -1
self.scheduled_next_break_time = None
self.paused_time = -1
# This event is fired before for a break
self.on_pre_break = EventHook()
# This event is fired just before the start of a break
self.on_start_break = EventHook()
# This event is fired at the start of a break
self.start_break = EventHook()
# This event is fired during every count down
self.on_count_down = EventHook()
# This event is fired at the end of a break
self.on_stop_break = EventHook()
# This event is fired when deciding the next break time
self.on_update_next_break = EventHook()
self.waiting_condition = threading.Condition()
self.lock = threading.Lock()
self.context = context
self.context['skipped'] = False
self.context['postponed'] = False
self.context['state'] = State.WAITING
self.default_postpone_duration = 0
self.pre_break_warning_time = 0
self.running = False
self.scheduled_next_break_timestamp = -1
self.scheduled_next_break_time = None
self.paused_time = -1
# This event is fired before for a break
self.on_pre_break = EventHook()
# This event is fired just before the start of a break
self.on_start_break = EventHook()
# This event is fired at the start of a break
self.start_break = EventHook()
# This event is fired during every count down
self.on_count_down = EventHook()
# This event is fired at the end of a break
self.on_stop_break = EventHook()
# This event is fired when deciding the next break time
self.on_update_next_break = EventHook()
self.waiting_condition = threading.Condition()
self.lock = threading.Lock()
self.context = context
self.context['skipped'] = False
self.context['postponed'] = False
self.context['state'] = State.WAITING