remove threading from util
This commit is contained in:
@@ -10,28 +10,10 @@ __status__ = "Development"
|
|||||||
|
|
||||||
|
|
||||||
# Default
|
# Default
|
||||||
import threading
|
|
||||||
import logging
|
import logging
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
|
|
||||||
class MyTimer(threading.Timer):
|
|
||||||
def run(self):
|
|
||||||
print(self.__dict__)
|
|
||||||
print(f"{self._name} Run once")
|
|
||||||
while not self.finished.wait(self.interval):
|
|
||||||
print(f"{self._name} Run x")
|
|
||||||
self.function(*self.args, **self.kwargs)
|
|
||||||
print(f"{self._name} Ran x")
|
|
||||||
print(f"{self._name} Run end")
|
|
||||||
|
|
||||||
|
|
||||||
def maketimer(cooldown, func):
|
|
||||||
timer = MyTimer(cooldown, func)
|
|
||||||
timer.daemon = True
|
|
||||||
return timer
|
|
||||||
|
|
||||||
|
|
||||||
def setupLogger():
|
def setupLogger():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user