1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-24 02:22:20 +00:00

Example plugin and README file

This commit is contained in:
J. Fernando Sánchez
2015-10-08 19:07:48 +02:00
parent 6561201cc2
commit ed22679e7c
3 changed files with 52 additions and 0 deletions

17
example-plugin/example.py Normal file
View File

@@ -0,0 +1,17 @@
from senpy.plugins import SentimentPlugin
from senpy.models import Response
import logging
logger = logging.getLogger(__name__)
class ExamplePlugin(SentimentPlugin):
def __init__(self, *args, **kwargs):
super(ExamplePlugin, self).__init__(*args, **kwargs)
logger.warn('%s: the answer to life, the universe and everything'
% self._info.get('custom_attribute'))
def analyse(self, *args, **kwargs):
logger.warn('Analysing with the example')
return Response()

View File

@@ -0,0 +1,16 @@
{
"name": "ExamplePlugin",
"module": "example",
"description": "I am just an example",
"author": "@balkian",
"version": "0.1",
"extra_params": {
"timeout": {
"@id": "timeout_sleep",
"aliases": ["timeout", "to"],
"required": false,
"default": 0
}
},
"custom_attribute": "42"
}