mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-14 12:42:27 +00:00
bfc588a915
* Refactored BaseModel for efficiency * Added plugin metaclass to keep track of plugin types * Moved plugins to examples dir (in a previous commit) * Simplified validation in parse_params * Added convenience methods to mock requests in tests * Changed help schema to use `.valid_parameters` instead of `.parameters`, which was used in results to show parameters provided by the user. * Improved UI * Added basic parameters * Fixed bugs in parameter handling * Refactored and cleaned code
15 lines
327 B
Python
15 lines
327 B
Python
from senpy.plugins import AnalysisPlugin
|
|
from time import sleep
|
|
|
|
|
|
class SleepPlugin(AnalysisPlugin):
|
|
def activate(self, *args, **kwargs):
|
|
sleep(self.timeout)
|
|
|
|
def analyse_entry(self, entry, params):
|
|
sleep(float(params.get("timeout", self.timeout)))
|
|
yield entry
|
|
|
|
def test(self):
|
|
pass
|