Skip to main content

No project description provided

Project description

Kore

Testing

Install packages required for testing:

$ pip install -r requirements_dev.txt

Run unit tests with pytest:

$ py.test

Creating application

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

Running application

$ uwsgi --http :8000 --wsgi kore.application --pyargv=you_project/confs/project.ini

Listing components

$ kore you_project/confs/project.ini -l

Creating plugins

Create your plugin module:

$ mkdir my_own_plugin
$ touch my_own_plugin/__init__.py

Create components

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:

  1. It must be callable.

  2. It must accept the container as the only argument.

  3. 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)

Enabling plugin

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,
)

Generating documentation

# 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

kore-0.0.1-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

kore-0.0.1-py2-none-any.whl (11.7 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page