51Degrees Pipeline for Python

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder Class Reference

Detailed Description

A PipelineBuilder generates a Pipeline object
Before construction of the Pipeline, FlowElements are added to it
There are also options for how JavaScript is output from the Pipeline

Inheritance diagram for fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder:

[legend]

Collaboration diagram for fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder:

[legend]

Public Member Functions

 __init__ (self, settings={})
 get_javascript_elements (self)
 get_setheader_elements (self)
 add (self, flow_element)
 build (self)
 add_logger (self, logger)
 build_from_configuration (self, config)

Public Attributes

list flow_elements = []
 logger = Logger()
bool add_javaScriptbuilder = settings["add_javascript_builder"]
 javascriptbuilder_settings = settings["javascript_builder_settings"]
bool use_setheader_properties = settings["use_setheader_properties"]
 data_file_update_service = settings["data_file_update_service"]
bool suppress_process_exceptions = settings["suppress_process_exceptions"]
bool auto_close_elements = settings["auto_close_elements"]

Protected Member Functions

 _get_suppress_process_exceptions (self, config)
 _map_properties_names (self, mappings, arguments)

Constructor & Destructor Documentation

◆ __init__()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.__init__ ( self,
settings = {} )
Pipeline Builder constructor.
@type settings: dictionary
@param settings : settings for the pipeline builder including:
`add_javascript_builder (Bool)` - Whether to add the JavaScriptBuilder to the pipeline
(default true)
`javascript_builder_settings (dict)` - Settings for the JavaScriptBuilder engine 
@rtype: PipelineBuilder
`use_setheader_properties (Bool)` - Whether to add the SetHeaderElement to the pipeline
(default true)
`suppress_process_exceptions (Bool)` - If False (the default) the first error thrown
while processing is re-raised from flow_data.process(); if True, errors are stored on
flow_data.errors and process() returns normally. Recommended True for web apps so a
processing failure degrades gracefully instead of failing the request.
`auto_close_elements (Bool)` - Whether closing the pipeline closes its flow elements
(default true). Set to False when the elements are shared with another pipeline,
and close each element once every pipeline using it is finished with.
@return: Returns a Pipeline Builder

Member Function Documentation

◆ _get_suppress_process_exceptions()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder._get_suppress_process_exceptions ( self,
config )
protected
Resolve the suppress_process_exceptions setting from a configuration.
Looks under 'PipelineOptions.BuildParameters' (mirrors the .NET/Java
config layout for cross-language consistency), then a direct
'PipelineOptions' key, accepting either snake_case or camelCase, and
finally falls back to the value supplied to the builder constructor
(default False).

@type config: dict
@param config: pipeline configuration
@rtype: bool
@return: whether processing exceptions should be suppressed

◆ _map_properties_names()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder._map_properties_names ( self,
mappings,
arguments )
protected

◆ add()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.add ( self,
flow_element )
Add a flow_element to a list of flowElements be used in a pipeline.

@type flow_element: FlowElement
@param flow_element: flowElement to be added to the pipeline

@rtype: PipelineBuilder
@return: Returns the pipleine builder with the specified flowElement added to it's list of flowElements.

◆ add_logger()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.add_logger ( self,
logger )
Add an instance of the logger class to the pipeline.

@type logger: Logger
@param logger: Logger to be added to the pipeline

@rtype: PipelineBuilder
@return: Returns the pipeline builder with the specified Logger added.

◆ build()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.build ( self)
Construct an immutable Pipeline using the list of flowElements, (Engines) and (Logger) currently in this Pipeline Builder.
Call build after all items to be included in the pipeline have been added.

@rtype: Pipeline
@return: Returns a Pipeline

◆ build_from_configuration()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.build_from_configuration ( self,
config )
Build a pipeline from a configuration file

@type config: dict
@param config: pipeline configuration

@rtype: Pipeline
@return: Returns built pipeline

If an element fails to build, the elements already built are closed
and the error is raised.

◆ get_javascript_elements()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.get_javascript_elements ( self)
Adds the JavaScriptBuilder, JSONBundler and SequenceElement to the pipeline if
If add_javascript_builder is set to true (the default)
@rtype: list
@return: Returns a list of FlowElements     

◆ get_setheader_elements()

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.get_setheader_elements ( self)
Adds the SetHeaderElement to the pipeline if
If use_setheader_properties is set to true (the default)
@rtype: list
@return: Returns a list of FlowElements     

Member Data Documentation

◆ add_javaScriptbuilder

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.add_javaScriptbuilder = settings["add_javascript_builder"]

◆ auto_close_elements

bool fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.auto_close_elements = settings["auto_close_elements"]

◆ data_file_update_service

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.data_file_update_service = settings["data_file_update_service"]

◆ flow_elements

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.flow_elements = []

◆ javascriptbuilder_settings

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.javascriptbuilder_settings = settings["javascript_builder_settings"]

◆ logger

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.logger = Logger()

◆ suppress_process_exceptions

bool fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.suppress_process_exceptions = settings["suppress_process_exceptions"]

◆ use_setheader_properties

fiftyone_pipeline_core.pipelinebuilder.PipelineBuilder.use_setheader_properties = settings["use_setheader_properties"]