mirror of
https://github.com/gsi-upm/senpy
synced 2024-12-04 21:32:31 +00:00
18 lines
481 B
Python
18 lines
481 B
Python
from senpy.plugins import SenpyPlugin
|
|
from senpy.models import Response
|
|
from time import sleep
|
|
|
|
|
|
class SleepPlugin(SenpyPlugin):
|
|
|
|
def __init__(self, info, *args, **kwargs):
|
|
super(SleepPlugin, self).__init__(info, *args, **kwargs)
|
|
self.timeout = int(info["timeout"])
|
|
|
|
def activate(self, *args, **kwargs):
|
|
sleep(self.timeout)
|
|
|
|
def analyse(self, *args, **kwargs):
|
|
sleep(float(kwargs.get("timeout", self.timeout)))
|
|
return Response()
|