Main Reference

The chrysalio Module

The main() function is called when the pserve command is invoked against this application.

chrysalio.main(global_config, **settings)[source]

This function returns a Pyramid WSGI application.

Parameters:
  • global_config (dict) – Dictionary describing the INI file with keys __file__ and here.

  • settings (dict) – Application settings of [app:main] section of INI file.

Return type:

pyramid.router.Router

Returns:

WSGI application.

The chrysalio.initialize Module

Main class to initialize the application.

class chrysalio.initialize.Initialize(configurator: Configurator)[source]

Initialization application class.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

complete(global_config: dict, package: str, populate_script: str)[source]

Check settings and create registry objects.

Parameters:
  • global_config (dict) – Dictionary describing the INI file with keys __file__ and here.

  • package (str) – Name of the calling package.

  • populate_script (str) – Name of populate script.

add_static_views(package: str, statics: tuple)[source]

Add static views.

Parameters:
  • package (str) – Name of the calling package.

  • statics (tuple) – A tuple of tuples such as (static_name, static_abs_path).

The chrysalio.menu Module

Main menu management.

chrysalio.menu.includeme(configurator: Configurator)[source]

Function to include menu functionality.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

chrysalio.menu.before_render(event: BeforeRender)[source]

A subscriber for pyramid.events.BeforeRender events to add a main menu.

Parameters:

event (pyramid.events.BeforeRender) – Current event.

The chrysalio.relaxng Module

Chrysalio main Relax NG.

chrysalio.relaxng.includeme(configurator)[source]

Function to include Relax NG.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

configurator.registry['relaxng'] is a dictionary describing the main Relax NG with the following keys:

  • 'root': the name of the root element, possibly with namespace

  • 'version': the value of attribute version

  • 'file': the path to the Relax NG file

The chrysalio.routes Module

Route definitions.

chrysalio.routes.includeme(configurator: Configurator)[source]

Function to include routes.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

The chrysalio.security Module

Security functionalities.

chrysalio.security.includeme(configurator: Configurator)[source]

Function to include authentication mechanism.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

class chrysalio.security.SessionAuthenticationPolicy(secret, callback=None, cookie_name='auth_tkt', secure=False, include_ip=False, timeout=None, reissue_time=None, max_age=None, path='/', http_only=False, wild_domain=True, debug=False, hashalg='sha512', parent_domain=False, domain=None, samesite='Lax')[source]

Authentication policy class based on session.

authenticated_userid(request) str | None[source]

Return the authenticated usr ID or None if no authenticated user ID can be found.

Parameters:

request (pyramid.request.Request) – Current request.

Return type:

str or None

effective_principals(request: Request) list[source]

Return a list of principals including, at least, pyramid.security.Everyone.

Parameters:

request (pyramid.request.Request) – Current request.

Returns:

list

class chrysalio.security.RootFactory(request: Request)[source]

Access Control List (ACL) definition.

Parameters:

request (pyramid.request.Request) – Current request.

The chrysalio.subscribers Module

Subscriber definition.

chrysalio.subscribers.includeme(configurator)[source]

Function to include subscribers.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

chrysalio.subscribers.before_render(event)[source]

A subscriber for pyramid.events.BeforeRender events.

Parameters:

event (pyramid.events.BeforeRender) – Current event.