flatisfy.web package

Submodules

flatisfy.web.app module

This module contains the definition of the Bottle web app.

class flatisfy.web.app.QuietWSGIRefServer(host='127.0.0.1', port=8080, **options)[source]

Bases: bottle.WSGIRefServer

Quiet implementation of Bottle built-in WSGIRefServer, as Canister is handling the logging through standard Python logging.

quiet = True
run(app)[source]
flatisfy.web.app.get_app(config)[source]

Get a Bottle app instance with all the routes set-up.

Returns:The built bottle app.

flatisfy.web.configplugin module

This module contains a Bottle plugin to pass the config argument to any route which needs it.

This module is heavily based on code from [Bottle-SQLAlchemy](https://github.com/iurisilvio/bottle-sqlalchemy) which is licensed under MIT license.

class flatisfy.web.configplugin.ConfigPlugin(config)[source]

Bases: object

A Bottle plugin to automatically pass the config object to the routes specifying they need it.

KEYWORD = 'config'
api = 2
apply(callback, route)[source]

Method called on route invocation. Should apply some transformations to the route prior to returing it.

We check the presence of self.KEYWORD in the route signature and replace the route callback by a partial invocation where we replaced this argument by a valid config object.

name = 'config'
setup(app)[source]

Make sure that other installed plugins don’t affect the same keyword argument and check if metadata is available.

flatisfy.web.configplugin.Plugin

alias of flatisfy.web.configplugin.ConfigPlugin

flatisfy.web.dbplugin module

This module contains a Bottle plugin to pass the database argument to any route which needs it.

This module is heavily based on code from [Bottle-SQLAlchemy](https://github.com/iurisilvio/bottle-sqlalchemy) which is licensed under MIT license.

class flatisfy.web.dbplugin.DatabasePlugin(get_session)[source]

Bases: object

A Bottle plugin to automatically pass an SQLAlchemy database session object to the routes specifying they need it.

KEYWORD = 'db'
api = 2
apply(callback, route)[source]

Method called on route invocation. Should apply some transformations to the route prior to returing it.

We check the presence of self.KEYWORD in the route signature and replace the route callback by a partial invocation where we replaced this argument by a valid SQLAlchemy session.

name = 'database'
setup(app)[source]

Make sure that other installed plugins don’t affect the same keyword argument and check if metadata is available.

flatisfy.web.dbplugin.Plugin

alias of flatisfy.web.dbplugin.DatabasePlugin

Module contents