No project description provided
Install packages required for testing:
$ pip install -r requirements_dev.txt
Run unit tests with pytest:
Add kore to your package requirements:
$ echo "kore" >> requirements.txt
Create your own application plugin (see Creating plugins) or use existing ones:
kore-falcon-plugins for Falcon application
kore-wimq-plugins for WIMQ application
$ uwsgi --http :8000 --wsgi kore.application --pyargv=you_project/confs/project.ini
$ kore you_project/confs/project.ini -l
Create your plugin module:
$ mkdir my_own_plugin $ touch my_own_plugin/__init__.py
A component creates and returns a particular value or object. It has the ability to utilize an injected container to retrieve the necessary configuration settings and dependencies.
The container expects a component to adhere to the following rules:
It must be callable.
It must accept the container as the only argument.
It must return anything except None.
Create components.py file inside plugin module:
def add_components(component): @component def my_own_component_1(container): return ComponentFactory()
Create component hooks
A component hook is one time components usage. Inside hooks you can connect them together or configure. Hooks will be executed after all components are added.
Create hooks.py file inside plugin module:
def add_hooks(container): application = container('application') my_own_component_1 = container('my_own_component_1') application.add_signal('launched', my_own_component_1)
Every plugin should have entry point(s) in setup.py to be enabled
entry_points = """\ [kore.components] my_own_components = my_own_plugin.components:add_components [kore.component_hooks] my_own_hooks = my_own_plugin.hooks:add_hooks """ setup( name='your_project_name', # .. entry_points=entry_points, )
# While executing the following lines you may expect a lot of # warnings. The command below goes through *.py files in project # directory and generates *.rst files in docs/src directory. $ sphinx-apidoc -fo docs kore # The command below generates *.html in docs/build from *.rst in docs $ sphinx-build -b html docs docs/build
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.