Integrating Ooze with bottle.py

Overview

Included in this package is a bottle.py plugin that allows Ooze to seamlessly integrate with Bottle route functions. Simply .install() the plugin and Ooze dependencies will automatically be injected into your bottle functions:

 1import ooze
 2from bottle import Bottle
 3
 4@ooze.provide
 5def add_numbers(x, y):
 6    return x + y
 7
 8app = Bottle()
 9app.install(ooze.OozeBottlePlugin())
10
11@app.get('/add/<x>/<y>')
12def web_add(x, y, add_numbers):
13    return {
14        'sum': add_numbers(x, y)
15    }