1
0
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:
J. Fernando Sánchez
2019-04-04 12:56:46 +02:00
parent fa993c6e2a
commit 4f286057c9
13 changed files with 239 additions and 247 deletions

View File

@@ -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()