Module fmeobjects :: Class FMESession
[hide private]
[frames] | no frames]

Class FMESession


init(directives)

FMESession class. 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.

Instance Methods [hide private]
 
__init__(directives)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
None
configure(configRow)
Passes the configuration information to the session.
unicode
decodeFromFMEParsableText(parsableText)
This method performs a modification of the unicode string from parsable FME encoded text back to a non-encoded form.
unicode
encodeToFMEParsableText(inputText)
This method performs a modification of the unicode string to parsable FME encoded text.
int
fmeBuildNumber()
Returns the current build number of FME.
string
fmeHome()
Returns directory FME was installed into.
string
fmeVersion()
Returns the current version of FME.
dict
getAllProperties()
Returns a list of all property values.
string
getLastErrorMsg()
Returns the last error message that FME encountered.
int
getLastErrorNum()
Returns the last error number that FME encountered.
string
getLastErrorStackTrace()
Get the stack trace associated with the last error that FME encountered.
list of strings
getProperties(propertyCategory, properties)
This method is used to retrieve a variety of information on a FMESession or use a session to perform certain operations.
list of FMEFeature
getSchemaFeatures(macros, prefix, schemaFile, schemaFeatures)
Retrieves the schema features defined in the DEF lines that are prefixed with 'prefix' in the 'schemaFile'.
list of strings
getSettings(keyword)
Returns the values of the keyword for the session configuration.
None
logSettings(keyword)
Dumps the current session configuration to the logfile.
None
updateSettings(keyword, value)
Adds a new keyword and value to the session configuration.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(directives)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • directives (dict) - Specify one or more additional directives to the session. All objects in the dict must be strings. Applicable directives can be found in the FME Configuration section of the 'FME Fundamentals' documentation.
Raises:
  • FMEException - An exception is raised if an error occurred
Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

configure(configRow)

 

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

Parameters:
  • configRow (list of string) - The configuration information.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

decodeFromFMEParsableText(parsableText)

 

This method performs a modification of the unicode string 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 (string or unicode) - FME encoded text as a string or unicode.
Returns: unicode
Non-encoded text as unicode.

encodeToFMEParsableText(inputText)

 

This method performs a modification of the unicode string 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 (unicode) - Non-encoded text.
Returns: unicode
FME encoded text.

fmeHome()

 

Returns directory FME was installed into.

Returns: string
The home directory of FME.

getAllProperties()

 

Returns a list of all property values.

Returns: dict
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.

Returns: string
The last error message.

getLastErrorNum()

 

Returns the last error number that FME encountered.

Returns: int
The last error number.

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 (string) - The property to retrieve or action to perform.
  • properties (dict or list of strings) - Additional information to specify what to retrieve or action to perform.
Returns: list of strings
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 of strings or dict) - Name-value pairs that define values for each macro used in the 'schemaFile'.
  • prefix (string) - Prefix used to retrieve schema features.
  • schemaFile (string) - The file name of the file containing the schema features.
Returns: list of 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 strings returned will be empty if the keyword is invalid or does not exist in the current session.

Parameters:
  • keyword (string) - The keyword for the session configuration.
Returns: list of strings
A list of strings 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 (string) - The keyword for the session configuration.
Returns: None

updateSettings(keyword, value)

 

Adds a new keyword and value to the session configuration.

Parameters:
  • keyword (string) - The new keyword to add to the configuration.
  • value (string) - The value of the keyword to add to the configuration.
Returns: None
Raises:
  • FMEException - An exception is raised if there was a problem in adding the new keyword and value.