\r\n

51Degrees Pipeline Python  4.4

51Degrees Pipeline for Python

fiftyone_pipeline_engines.datafile.DataFile Class Reference

Detailed Description

A datafile used by a FlowElement / Engine to get calculate properties values.

Public Member Functions

def  __init__ (self, flow_element, identifier, update_url_params=None, data=None, path="", temp_directory=tempfile.gettempdir(), create_temp_copy=True, auto_update=True, file_system_watcher=True, polling_interval=30, update_time_maximum_randomisation=10, verify_md5=True, decompress=True, download=True, verify_if_modified_since=True, update_on_start=False)
Constructor for a DataFile. More...
def  get_date_published (self)
Function called to get the date the datafile was published. More...
def  get_next_update (self)
Function called to get the date of the next datafile version. More...
def  refresh (self, identifier)
Function called when datafile has been updated. More...
def  get_update_url (self)
Internal function that constructs the url for the datafile update service to use from the result of get_url_formatter. More...
def  get_url_formatter (self)
Function that constructs the url for the datafile update service to use. More...

Public Attributes

 identifier
 update_url_params
 temp_directory
 create_temp_copy
 auto_update  file_system_watcher  polling_interval  update_time_maximum_randomisation  verify_md5  decompress  download  verify_if_modified_since  update_on_start  updated_on_start  data  path  updating

Constructor & Destructor Documentation

◆ __init__()

def fiftyone_pipeline_engines.datafile.DataFile.__init__ (   self,
  flow_element,
  identifier,
  update_url_params = None,
  data = None,
  path = "",
  temp_directory = tempfile.gettempdir(),
  create_temp_copy = True,
  auto_update = True,
  file_system_watcher = True,
  polling_interval = 30,
  update_time_maximum_randomisation = 10,
  verify_md5 = True,
  decompress = True,
  download = True,
  verify_if_modified_since = True,
  update_on_start = False  
)

Constructor for a DataFile.

@type flow_element: FlowElement

Parameters
flow_element - The FlowElement using the datafile @type identifier : string
identifier - : Name of the datafile @type update_url_params: dict
update_url_params - Dictionary containing parameters used to construct the datafile update url @type data: mixed
data - Data to use in the datafile if kept in memory rather than file @type path: string
path - path to the data file itself @type temp_directory: string
temp_directory - temporary file location (defaults to the operating system defualt) @type create_temp_copy: bool
create_temp_copy - whether to copy datafile to temporary location when updating @type auto_update: bool
- auto_update: whether to automatically update the datafile when required @type file_system_watcher: bool
file_system_watcher - whether to check the datafile's path for changes and update the connected FlowElement's data automatically when the file is changed in the operating system @type polling_interval: int
polling_interval - How often to poll for updates to the datafile (minutes) @type update_time_maximum_randomisation : int
update_time_maximum_randomisation - : Maximum randomisation offset in seconds to polling time interval @type verify_md5 : bool
verify_md5 - : whether to check a 'content-md5' header in the data file update service against the datafile to verify its contents @type decompress: bool
- is the datafile gziped when returning from the update service? @type download: bool
download - should the datafile be downloaded or stored in memory @type update_on_start : bool
update_on_start - : When this is set to true the datafile is updated / downloaded immediately on initialisation. This is useful if no initial datafile is present. @type verify_if_modified_since : bool
verify_if_modified_since - : whether to check an "If-Modified-Since" header on the update service against the last datafile update date

Member Function Documentation

◆ get_date_published()

def fiftyone_pipeline_engines.datafile.DataFile.get_date_published (   self )

Function called to get the date the datafile was published.

Returns
date: Date the datafile was published

◆ get_next_update()

def fiftyone_pipeline_engines.datafile.DataFile.get_next_update (   self )

Function called to get the date of the next datafile version.

Returns
date: Date of the next update

◆ get_update_url()

def fiftyone_pipeline_engines.datafile.DataFile.get_update_url (   self )

Internal function that constructs the url for the datafile update service to use from the result of get_url_formatter.

◆ get_url_formatter()

def fiftyone_pipeline_engines.datafile.DataFile.get_url_formatter (   self )

Function that constructs the url for the datafile update service to use.

◆ refresh()

def fiftyone_pipeline_engines.datafile.DataFile.refresh (   self,
  identifier  
)

Function called when datafile has been updated.

Defaults to a refresh method on the attached FlowElement @type identifier : string

Parameters
identifier - : identifier of the datafile

Member Data Documentation

◆ auto_update

fiftyone_pipeline_engines.datafile.DataFile.auto_update

◆ create_temp_copy

fiftyone_pipeline_engines.datafile.DataFile.create_temp_copy

◆ data

fiftyone_pipeline_engines.datafile.DataFile.data

◆ decompress

fiftyone_pipeline_engines.datafile.DataFile.decompress

◆ download

fiftyone_pipeline_engines.datafile.DataFile.download

◆ file_system_watcher

fiftyone_pipeline_engines.datafile.DataFile.file_system_watcher

◆ flow_element

fiftyone_pipeline_engines.datafile.DataFile.flow_element

◆ identifier

fiftyone_pipeline_engines.datafile.DataFile.identifier

◆ path

fiftyone_pipeline_engines.datafile.DataFile.path

◆ polling_interval

fiftyone_pipeline_engines.datafile.DataFile.polling_interval

◆ temp_directory

fiftyone_pipeline_engines.datafile.DataFile.temp_directory

◆ update_on_start

fiftyone_pipeline_engines.datafile.DataFile.update_on_start

◆ update_time_maximum_randomisation

fiftyone_pipeline_engines.datafile.DataFile.update_time_maximum_randomisation

◆ update_url_params

fiftyone_pipeline_engines.datafile.DataFile.update_url_params

◆ updated_on_start

fiftyone_pipeline_engines.datafile.DataFile.updated_on_start

◆ updating

fiftyone_pipeline_engines.datafile.DataFile.updating

◆ verify_if_modified_since

fiftyone_pipeline_engines.datafile.DataFile.verify_if_modified_since

◆ verify_md5

fiftyone_pipeline_engines.datafile.DataFile.verify_md5
On This Page