]> git.ipfire.org Git - oddments/collecty.git/commitdiff
Drop unused Timer class
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 20 Sep 2020 14:05:27 +0000 (14:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 20 Sep 2020 14:05:27 +0000 (14:05 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/collecty/plugins/__init__.py
src/collecty/plugins/base.py

index 031a6d940660611ddaee543c616eca5b89a323ae..147a1b6ee977042f7f0a5edaf37a4bb0d266a710 100644 (file)
@@ -19,7 +19,7 @@
 #                                                                             #
 ###############################################################################
 
-from .base import Timer, get
+from .base import get
 
 from . import base
 from . import contextswitches
index 249f3950c4ba006735558da001df988925343759..c85e315958773f61c20762e3ce57f3f7b0fc8bab 100644 (file)
@@ -37,38 +37,6 @@ from ..i18n import _
 
 DEF_MATCH = re.compile(r"C?DEF:([A-Za-z0-9_]+)=")
 
-class Timer(object):
-       def __init__(self, timeout, heartbeat=1):
-               self.timeout = timeout
-               self.heartbeat = heartbeat
-
-               self.delay = 0
-
-               self.reset()
-
-       def reset(self, delay=0):
-               # Save start time.
-               self.start = time.time()
-
-               self.delay = delay
-
-               # Has this timer been killed?
-               self.killed = False
-
-       @property
-       def elapsed(self):
-               return time.time() - self.start - self.delay
-
-       def cancel(self):
-               self.killed = True
-
-       def wait(self):
-               while self.elapsed < self.timeout and not self.killed:
-                       time.sleep(self.heartbeat)
-
-               return self.elapsed > self.timeout
-
-
 class Environment(object):
        """
                Sets the correct environment for rrdtool to create