1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-09-18 12:32:21 +00:00

Compare commits

..

20 Commits
0.5.7 ... nacho

Author SHA1 Message Date
NachoCP
0c54370e28 Docs updated 2016-03-18 13:05:51 +01:00
NachoCP
818b4599a9 Update demo.rst 2016-03-17 11:42:49 +01:00
NachoCP
25ac0220e4 Update usage.rst 2016-03-17 10:45:14 +01:00
NachoCP
c22f825fef Update demo.rst 2016-03-17 10:27:46 +01:00
NachoCP
38a3ce4cae Added files via upload 2016-03-17 10:27:17 +01:00
NachoCP
61739a1903 Delete senpy-demo.png 2016-03-17 10:26:47 +01:00
NachoCP
10ed836f2f Added files via upload 2016-03-17 10:26:36 +01:00
NachoCP
e861054cbc Delete senpy-demo.png 2016-03-17 10:26:12 +01:00
NachoCP
d93a7f7973 Update demo.rst 2016-03-17 10:25:26 +01:00
NachoCP
14459847ac Added files via upload 2016-03-17 10:24:50 +01:00
NachoCP
ce275d6c4f Delete senpy-demo.png 2016-03-17 10:24:42 +01:00
NachoCP
b34e0e65a6 Added files via upload 2016-03-17 10:21:44 +01:00
NachoCP
a8ab5bd908 Update index.rst 2016-03-17 09:52:35 +01:00
NachoCP
f8e8ec19e8 Create demo.rst 2016-03-17 09:52:23 +01:00
NachoCP
e83a397588 Update plugins.rst 2016-03-17 09:43:25 +01:00
NachoCP
382b8b0a50 Update plugins.rst 2016-03-17 09:39:33 +01:00
NachoCP
7f0d76665a Update plugins.rst 2016-03-16 19:44:01 +01:00
NachoCP
fe4ee87813 Update usage.rst 2016-03-16 18:03:32 +01:00
NachoCP
23796b81af Update usage.rst 2016-03-16 17:48:19 +01:00
NachoCP
69296a21cb Update usage.rst 2016-03-16 17:47:18 +01:00
12 changed files with 7 additions and 50 deletions

1
.gitignore vendored
View File

@@ -5,4 +5,3 @@ dist
build build
README.html README.html
__pycache__ __pycache__
Dockerfile-*

View File

@@ -1,3 +0,0 @@
from python:{{PYVERSION}}-onbuild
ENTRYPOINT ["python", "-m", "senpy", "-f", ".", "--host", "0.0.0.0"]

View File

@@ -2,7 +2,6 @@ include requirements.txt
include test-requirements.txt include test-requirements.txt
include README.md include README.md
include senpy/context.jsonld include senpy/context.jsonld
include senpy/VERSION
graft senpy/plugins graft senpy/plugins
graft senpy/schemas graft senpy/schemas
graft senpy/templates graft senpy/templates

View File

@@ -1,29 +0,0 @@
PYVERSIONS=2.7 3.4
NAME=senpy
REPO=gsiupm
VERSION=$(shell cat $(NAME)/VERSION)
all: build run
dockerfiles: $(addprefix Dockerfile-,$(PYVERSIONS))
Dockerfile-%: Dockerfile.template
sed "s/{{PYVERSION}}/$*/" Dockerfile.template > Dockerfile-$*
build: $(addprefix build-, $(PYVERSIONS))
build-%: Dockerfile-%
docker build -t '$(REPO)/$(NAME):$(VERSION)-python$*' -f Dockerfile-$* .;
test: $(addprefix test-,$(PYVERSIONS))
test-%: build-%
docker run --rm -w /usr/src/app/ --entrypoint=/usr/local/bin/python -ti '$(REPO)/$(NAME):$(VERSION)-python$*' setup.py test ;
test_pip-%:
docker run --rm -ti python:$* pip -q install senpy ;
test_pip: $(addprefix test_pip-,$(PYVERSIONS))
.PHONY: test test-% build-% build test test_pip

View File

@@ -30,7 +30,7 @@ Alternatively, you can use the development version:
.. code:: bash .. code:: bash
git clone http://github.com/gsi-upm/senpy git clone git@github.com:gsi-upm/senpy
cd senpy cd senpy
pip install --user . pip install --user .

View File

@@ -2,8 +2,6 @@ Developing new plugins
---------------------- ----------------------
Each plugin represents a different analysis process.There are two types of files that are needed by senpy for loading a plugin: Each plugin represents a different analysis process.There are two types of files that are needed by senpy for loading a plugin:
Plugins Interface
=======
- Definition file, has the ".senpy" extension. - Definition file, has the ".senpy" extension.
- Code file, is a python file. - Code file, is a python file.
@@ -36,7 +34,7 @@ The basic methods in a plugin are:
* __init__ * __init__
* activate: used to load memory-hungry resources * activate: used to load memory-hungry resources
* deactivate: used to free up resources * deactivate: used to free up resources
* analyse: called in every user requests. It takes in the parameters supplied by a user and should return a senpy Response. * analyse: called in every user requests. It takes in the parameters supplied by a user and should return a senpy Results.
Plugins are loaded asynchronously, so don't worry if the activate method takes too long. The plugin will be marked as activated once it is finished executing the method. Plugins are loaded asynchronously, so don't worry if the activate method takes too long. The plugin will be marked as activated once it is finished executing the method.

View File

@@ -9,4 +9,3 @@ six
future future
jsonschema jsonschema
jsonref jsonref
PyYAML

View File

@@ -1 +0,0 @@
0.5.7

View File

@@ -18,8 +18,4 @@
Sentiment analysis server in Python Sentiment analysis server in Python
""" """
import os __version__ = "0.5.5"
VFILE = os.path.join(os.path.dirname(__file__), "VERSION")
with open(VFILE, 'r') as f:
__version__ = f.read().strip()

View File

@@ -22,7 +22,7 @@ import imp
import logging import logging
import traceback import traceback
import gevent import gevent
import yaml import json
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -203,7 +203,7 @@ class Senpy(object):
logger.debug("Loading plugin: {}".format(filename)) logger.debug("Loading plugin: {}".format(filename))
fpath = os.path.join(root, filename) fpath = os.path.join(root, filename)
with open(fpath, 'r') as f: with open(fpath, 'r') as f:
info = yaml.load(f) info = json.load(f)
logger.debug("Info: {}".format(info)) logger.debug("Info: {}".format(info))
sys.path.append(root) sys.path.append(root)
module = info["module"] module = info["module"]

View File

@@ -15,8 +15,7 @@ except AttributeError:
install_reqs = [str(ir.req) for ir in install_reqs] install_reqs = [str(ir.req) for ir in install_reqs]
test_reqs = [str(ir.req) for ir in test_reqs] test_reqs = [str(ir.req) for ir in test_reqs]
with open('senpy/VERSION') as f: exec(open('senpy/__init__.py').read())
__version__ = f.read().strip()
setup( setup(
name='senpy', name='senpy',