repocribro.repocribro

repocribro.repocribro.AUTHOR = 'Marek Suchánek'

Author of the application

repocribro.repocribro.DEFAULT_CONFIG_FILES = ['config/app.cfg', 'config/auth.cfg', 'config/db.cfg']

Paths to default configuration files

class repocribro.repocribro.DI_Container

Simple container of services for web app

Variables:
  • factories – Factories of services
  • singletons – Singletons (shared objects) of services
__init__()

Prepare dict for storing services and factories

get(what, *args, **kwargs)

Retrieve service from the container

Parameters:
  • what (str) – Name of the service to get
  • args – Positional arguments passed to factory
  • kwargs – Keyword arguments passed to factory
Returns:

The service or None

set_factory(name, factory)

Set service factory (callable for creating instances)

Parameters:
  • name (str) – Name of the service
  • factory (callable) – Function or callable object creating service instance
set_singleton(name, singleton)

Set service as singleton (shared object)

Parameters:
  • name (str) – Name of the service
  • singleton (object) – The object to be shared as singleton
repocribro.repocribro.PROG_NAME = 'repocribro'

Name of the application

repocribro.repocribro.RELEASE = '0.1'

Actual release tag

class repocribro.repocribro.Repocribro

Repocribro is Flask web application

Variables:container – Service container for the app
__init__()

Setup Flask app and prepare service container

repocribro.repocribro.VERSION = '0.1'

Actual version

repocribro.repocribro.create_app(cfg_files=['DEFAULT'])

Factory for making the web Flask application

Parameters:cfg_files – Single or more config file(s)
Returns:Constructed web application
Return type:repocribro.repocribro.Repocribro