class glue.config.ExporterRegistry[source]

Bases: glue.config.Registry

Stores functions which can export an applocation to an output file

The members property is a list of exporters, each represented as a (label, save_function, can_save_function, outmode) tuple.

save_function takes an (application, path) as input, and saves the session

can_save_function takes an application as input, and raises an exception if saving this session is not possible

outmode is a string, with one of 3 values:
‘file’: indicates that exporter creates a file ‘directory’: exporter creates a directory ‘label’: exporter doesn’t write to disk, but needs a label

Methods Summary

add(label, exporter, checker[, outmode]) Add a new exporter

Methods Documentation

add(label, exporter, checker, outmode=None)[source]

Add a new exporter


label : str

Short label for the exporter

exporter : func

Exporter function which takes two arguments: the application and optionally the path or label to create. This function should raise an exception if export isn’t possible.

checker : func

Function that checks if saving is possible, which takes one argument: the application.

outmode : str or None

Indicates what kind of output is created. This can be either set to 'file', 'directory', 'label', or None.