sleep.py 327 Bytes
Newer Older
J. Fernando Sánchez's avatar
J. Fernando Sánchez committed
1
from senpy.plugins import AnalysisPlugin
2
3
from time import sleep

4

J. Fernando Sánchez's avatar
J. Fernando Sánchez committed
5
class SleepPlugin(AnalysisPlugin):
6
7
    def activate(self, *args, **kwargs):
        sleep(self.timeout)
8

J. Fernando Sánchez's avatar
J. Fernando Sánchez committed
9
10
11
    def analyse_entry(self, entry, params):
        sleep(float(params.get("timeout", self.timeout)))
        yield entry
J. Fernando Sánchez's avatar
J. Fernando Sánchez committed
12
13
14

    def test(self):
        pass