ExporterRegistry

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(self, label, exporter, checker[, outmode])

Add a new exporter

Methods Documentation

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

Add a new exporter

Parameters
labelstr

Short label for the exporter

exporterfunc

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.

checkerfunc

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

outmodestr or None

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