endi package

Subpackages

Submodules

endi.default_layouts module

class endi.default_layouts.DefaultLayout(context, request)

Bases : object

endi_version = '2024.1.0b1'
js_resource_group = <fanstatic.core.Group object>
class endi.default_layouts.OpaLayout(context, request)

Bases : DefaultLayout

property js_app_options
js_resource_group = <fanstatic.core.Group object>
class endi.default_layouts.VueOpaLayout(context, request)

Bases : OpaLayout

js_resource_group = <fanstatic.core.Group object>
endi.default_layouts.includeme(config)

endi.exception module

enDI specific exception

exception endi.exception.BadRequest(message=None)

Bases : Exception

Exception raised when the request is invalid (form invalid datas …)

asdict(translate=None)
message = 'La requête est incorrecte'
messages()

Used to fit colander’s Invalid exception api

exception endi.exception.Forbidden

Bases : Exception

Forbidden exception, used to raise a forbidden action error

message = "Vous n'êtes pas autorisé à effectuer cette action"
exception endi.exception.SignatureError

Bases : Forbidden

Exception for status modification calls with the wrong signature

message = 'Des informations manquent pour effectuer cette action'

endi.export_edp module

endi.interfaces module

endi.log module

Logging utility to allow logging ips into custom logs

class endi.log.CustomFileHandler(filename, mode='a', encoding=None, delay=False)

Bases : FileHandler, object

CustomeFile Handler allowing to add ip and username in logs

emit(record)

Emit a record.

If the stream was not opened because “delay” was specified in the constructor, open it before calling the superclass’s emit.

class endi.log.CustomStreamHandler(stream=None)

Bases : StreamHandler, object

CustomeStream Handler allowing to add ip and username in logs

emit(record)

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an “encoding” attribute, it is used to determine how to do the output to the stream.

endi.log.get_ip(request)

Return the client’s ip or None

endi.log.get_user(request)

Return the current user or anonymous

endi.pshell module

endi.pshell.setup(env)

endi.resources module

Handle static libraries inside enDI with the help of fanstatic

endi.resources.get_main_group()

Return the main resource Group that will be used on all pages

endi.resources.get_module_group()

Return main libraries used in custom modules (backbone marionette and handlebar stuff)

NB : depends on the main_group

endi.resources.get_module_resource(module, tmpl=False, extra_depends=())

Return a resource group (or a single resource) for the given module

static/js/<module>.js and static/js/templates/<module>.js

Paramètres:
  • module (str) – the name of a js file

  • tmpl (bool) – is there an associated tmpl

  • extra_depends – extra dependencies

endi.resources.get_opa_group()

Return the resources used on one page applications pages

endi.resources.get_opa_group_vue()
endi.resources.get_resource(filepath, minified=None, depends=None, bottom=False)

Return a resource object included in enDI

Module contents

Main file for our pyramid application

endi.add_base_directives_and_predicates(config)

Add custom predicates and directives used in enDI’s codebase

endi.add_http_error_views(config, settings)
endi.add_static_views(config, settings)

Add the static views used in enDI

endi.base_configure(config, dbsession, from_tests=False, **settings)

All plugin and others configuration stuff

endi.config_events(config)
endi.config_layouts(config)
endi.config_panels(config)
endi.config_services(config)

Setup the services (pyramid_services) used in enDI

endi.config_subscribers(config)
endi.config_views(config)

Configure endi views

endi.configure_traversal(config, dbsession) Configurator

Configure the traversal related informations - Set acls on models - Setup the root factory - Set the default permission

endi.enable_sqla_listeners()
endi.get_groups(login, request)

return the current user’s groups

endi.hack_endi_static_path(settings)
endi.include_custom_modules(config)

Include custom modules using the endi.includes mechanism

endi.main(global_config, **settings)

Main entry function

Renvoie:

a Pyramid WSGI application.

endi.prepare_config(**settings)

Prepare the configuration object to setup the main application elements

endi.prepare_view_config(config, dbsession, from_tests, **settings)

Prepare view configuration

Configure all tools used to include views

endi.setup_bdd(settings)

Configure the database:

  • Intialize tables

  • populate database with default values

Paramètres:

settings (obj) – The ConfigParser object

Renvoie:

The dbsession

Type renvoyé:

obj

endi.setup_request_methods(config, dbsession)
endi.version(strip_suffix=False) str

Return enDI’s version number (as defined in setup.py)

Param:

strip any suffix after patch release (ex: 1.2.3b3 → 1.2.3)