mirror of
https://github.com/gsi-upm/senpy
synced 2025-08-24 02:22:20 +00:00
Update to senpy 0.20
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from senpy.plugins import Analysis
|
||||
from senpy.plugins import AnalysisPlugin
|
||||
from senpy.models import Response, Entry
|
||||
|
||||
|
||||
class ExamplePlugin(Analysis):
|
||||
class ExamplePlugin(AnalysisPlugin):
|
||||
'''A *VERY* simple plugin that exemplifies the development of Senpy Plugins'''
|
||||
name = "example-plugin"
|
||||
author = "@balkian"
|
||||
@@ -10,6 +10,7 @@ class ExamplePlugin(Analysis):
|
||||
extra_params = {
|
||||
"parameter": {
|
||||
"@id": "parameter",
|
||||
"description": "this parameter does nothing, it is only an example",
|
||||
"aliases": ["parameter", "param"],
|
||||
"required": True,
|
||||
"default": 42
|
||||
@@ -17,7 +18,8 @@ class ExamplePlugin(Analysis):
|
||||
}
|
||||
custom_attribute = "42"
|
||||
|
||||
def analyse_entry(self, entry, params):
|
||||
def analyse_entry(self, entry, activity):
|
||||
params = activity.params
|
||||
self.log.debug('Analysing with the example.')
|
||||
self.log.debug('The answer to this response is: %s.' % params['parameter'])
|
||||
resp = Response()
|
||||
|
Reference in New Issue
Block a user