Skip to content
Snippets Groups Projects
Commit 46b82eb3 authored by shinedday's avatar shinedday
Browse files

Merge branch 'master' into 25-ajout-d-une-boite-au-lettre

parents 168bd64a 1f2ccab6
No related branches found
No related tags found
No related merge requests found
......@@ -165,6 +165,7 @@ class Amas(Schedulable, Loggable):
"""
exit the program at the end of the cycle
"""
self.put_token()
self.scheduler.exit_bool = True
def set_sleep(self, sleep_time) -> None:
......
......@@ -91,6 +91,8 @@ class Scheduler():
while not self.exit_bool:
self.__semaphore_start_stop.acquire()
if self.exit_bool:
return
self.__semaphore_start_stop.release()
threads = []
......
......@@ -7,9 +7,18 @@ class ToOverrideWarning:
"""
Warning raised a method that should be override is called
"""
__enable_warning = True
def __init__(
self,
name: str
) -> None:
print("[WARNING] : Method " + name + " was called without being override.")
if ToOverrideWarning.__enable_warning:
print("[WARNING] : Method " + name + " was called without being override.")
@classmethod
def enable_warning(cls, condition: bool) -> None:
"""
enable or disable custom warning for method that should be override
"""
cls.__enable_warning = condition
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment