fmeobjects.FMESession

Inheritance diagram of fmeobjects.FMESession

FMESession.configure(configRow)

Passes the configuration information to the session.

FMESession.decodeFromFMEParsableText(...)

This method performs a modification of the str from parsable FME encoded text back to a non-encoded form.

FMESession.encodeToFMEParsableText(inputText)

This method performs a modification of the str to parsable FME encoded text.

FMESession.fmeBuildNumber()

Returns the current build number of FME.

FMESession.fmeHome()

Returns directory FME was installed into.

FMESession.fmeVersion()

Returns the current version of FME.

FMESession.getAllProperties()

Returns a list of all property values.

FMESession.getLastErrorMsg()

Returns the last error message that FME encountered.

FMESession.getLastErrorNum()

Returns the last error number that FME encountered.

FMESession.getLastErrorStackTrace()

Get the stack trace associated with the last error that FME encountered.

FMESession.getProperties(propertyCategory, ...)

This method is used to retrieve a variety of information on a FMESession or use a session to perform certain operations.

FMESession.getSchemaFeatures(macros, prefix, ...)

Retrieves the schema features defined in the DEF lines that are prefixed with 'prefix' in the 'schemaFile'.

FMESession.getSettings(keyword)

Returns the values of the keyword for the session configuration.

FMESession.logSettings(keyword)

Dumps the current session configuration to the logfile.

FMESession.updateSettings(keyword, value)

Adds a new keyword and value to the session configuration.

class FMESession

FME Session Class

init(directives)

This object initializes the FMEObjects system. In order for the passed-in directives to take effect, this must be the first object created in your application.

Parameters:

directives (dict) – Specify one or more additional directives to the session. All objects in the dict must be str.

Raises:

FMEException – An exception is raised if an error occurred.

__init__(*args, **kwargs)
configure(configRow)

Passes the configuration information to the session. One use of this function is to define configuration lines for functions.

Parameters:

configRow (list[str]) – The configuration information.

Return type:

None

Raises:

FMEException – An exception is raised if an error occurred.

decodeFromFMEParsableText(parsableText)

This method performs a modification of the str from parsable FME encoded text back to a non-encoded form. For example, ‘<semicolon>’ will be replaced with ‘;’. If the decoding fails for a particular character sequence, the resulting output will retain that character sequence.

Parameters:

parsableText (str) – FME encoded text as a str.

Return type:

str

Returns:

Non-encoded text as str.

encodeToFMEParsableText(inputText)

This method performs a modification of the str to parsable FME encoded text. For example, ‘;’ will be replaced with the character sequence ‘<semicolon>’. If the encoding fails for a particular character sequence, the resulting output will retain that character sequence.

Parameters:

inputText (str) – Non-encoded text.

Return type:

str

Returns:

FME encoded text.

fmeBuildNumber()

Returns the current build number of FME.

Return type:

int

fmeHome()

Returns directory FME was installed into.

Return type:

str

Returns:

The home directory of FME.

fmeVersion()

Returns the current version of FME.

Return type:

str

getAllProperties()

Returns a list of all property values.

Return type:

dict

Returns:

The returned dict will contain a mapping of each property to its value for all properties found.

Raises:

FMEException – An exception is raised if no properties were found.

getLastErrorMsg()

Returns the last error message that FME encountered.

Return type:

str

Returns:

The last error message.

getLastErrorNum()

Returns the last error number that FME encountered.

Return type:

int

Returns:

The last error number.

getLastErrorStackTrace()

Get the stack trace associated with the last error that FME encountered.

Return type:

str

getProperties(propertyCategory, properties)

This method is used to retrieve a variety of information on a FMESession or use a session to perform certain operations. The operation performed is determined by a combination of the ‘propertyCategory’ specified and the ‘propertyConfig’ information passed in.

Parameters:
  • propertyCategory (str) – The property to retrieve or action to perform.

  • properties (dict or list[str]) – Additional information to specify what to retrieve or action to perform.

Return type:

list[str]

Returns:

The properties requested. This value is empty in cases where actions are performed.

Raises:

FMEException – An exception is raised if there was a problem in performing the specified getProperties operation.

getSchemaFeatures(macros, prefix, schemaFile, schemaFeatures)

Retrieves the schema features defined in the DEF lines that are prefixed with ‘prefix’ in the ‘schemaFile’.

Parameters:
  • macros (list[str] or dict) – Name-value pairs that define values for each macro used in the ‘schemaFile’.

  • prefix (str) – Prefix used to retrieve schema features.

  • schemaFile (str) – The file name of the file containing the schema features.

Return type:

list[FMEFeature]

Raises:

FMEException – An exception is raised if there was a problem retrieving the schema features.

getSettings(keyword)

Returns the values of the keyword for the session configuration. The list of str returned will be empty if the keyword is invalid or does not exist in the current session.

Parameters:

keyword (str) – The keyword for the session configuration.

Return type:

list[str]

Returns:

A list of str containing the settings, or an empty list if the keyword is invalid or does not exist.

Raises:

FMEException – An exception is raised if an error occurred.

logSettings(keyword)

Dumps the current session configuration to the logfile. No action will be performed if the keyword is unrecognized.

Parameters:

keyword (str) – The keyword for the session configuration.

Return type:

None

updateSettings(keyword, value)

Adds a new keyword and value to the session configuration.

Parameters:
  • keyword (str) – The new keyword to add to the configuration.

  • value (str) – The value of the keyword to add to the configuration.

Return type:

None

Raises:

FMEException – An exception is raised if there was a problem in adding the new keyword and value.