Components documentation

Here is the documentation of the parts not covered yet. You should not have to worry about those parts if you are writing a new driver, but they can be very useful if you want to hack the core of Onitu.

Launcher

Referee

The role of the Referee is to receive the events emitted by the drivers, and to send notifications to the other drivers accordingly to the configuration rules.

Utils

This module provides a set of classes and functions useful in several parts of Onitu.

onitu.utils.at_exit(callback, *args, **kwargs)[source]

Register a callback which will be called when a deadly signal comes

This funtion must be called from the main thread.

onitu.utils.get_available_drivers()[source]

Return a dict mapping the name of each installed driver with its entry point.

You can use it like that: ``` drivers = get_available_drivers() if ‘local_storage’ in drivers:

local_storage = drivers[‘local_storage’].load()

```

onitu.utils.get_fid(filename)[source]

Get the file-id (fid) of the given filename.

The file-id is a UUID version 5, with the namespace define in NAMESPACE_ONITU.

The purpose of the file-id is to avoid using filenames as a direct references to files inside Onitu.

onitu.utils.get_mimetype(filename)[source]

Get the MIME type of the given filename.

This avoids interfaces and clients of the Onitu instances having to determine the MIME type of the files they receive notifications from.