fietsboek package

Fietsboek is a web application to track and share GPX tours.

This is the documentation for the Python package, useful for developers that wish to work on fietsboek.

For more information, you can check out the following resources:

Content

fietsboek.check_update_state(config_uri)

Checks the update state of the data, and logs a warning if there is a mismatch.

Parameters:

config_uri (str) – Path to the configuration file.

fietsboek.locale_negotiator(request)

Negotiates the right locale to use.

This tries the following:

  1. It runs the default negotiator. This allows the locale to be overriden by using the _LOCALE_ query parameter.

  2. It checks for the presence of a fietsboek_locale cookie.

  3. It uses the Accept-Language header.

Parameters:

request (Request) – The request for which to get the language.

Return type:

Optional[str]

Returns:

The determined locale, or None if the default should be used.

fietsboek.main(global_config, **settings)

This function returns a Pyramid WSGI application.

fietsboek.maintenance_mode(handler, _registry)

A Pyramid Tween that handles the maintenance mode.

Note that we do this as a tween to ensure we check for the maintenance mode as early as possible. This avoids hitting the DB, which might be in an inconsistent state.

Parameters:
  • handler (Callable[[Request], Response]) – The next handler in the tween/view chain.

  • registry – The application registry.

Return type:

Callable[[Request], Response]

Subpackages

Submodules