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
(label, exporter, checker[, outmode])Add a new exporter Methods Documentation
-
add
(label, exporter, checker, outmode='file')[source]¶ Add a new exporter :param label: Short label for the exporter :type label: str
Parameters: - exporter (function(application)) – exporter function
- checker – function that checks if save is possible
exporter
should raise an exception if export isn’t possible.Parameters: outmode (str ('file' | 'directory' | 'label')) – What kind of output is created?