API for Global Mappings

Part of the Object based program API.

class GlobalMappingApi

API to access global mapping files

Returned by

CreateMapping()

Creates an empty Mapping.

Returns:

An empty mapping

Return type:

GlobalMapping

GetChanges(oldGlobalMapping, newGlobalMapping)

Get the changes that exist between two given global mappings.

Parameters:
oldGlobalMapping

The old global mapping to compare.

newGlobalMapping

The new global mapping to compare.

Returns:

The changes that exist between the two global mappings.

Return type:

list[Change]

OpenMapping(filename)

Opens an existing global mapping. Raises an ApiError if the referenced file does not exist.

Parameters:
filename : str

Mapping file path. Can be absolute or relative to the parameters-directory.

Returns:

Opened mapping.

Return type:

GlobalMapping

SearchGlobalMappings(searchCriteria, useExtendedMode=False)

Searches the current workspace and library workspaces for Global Mappings matching the given search criteria.

Parameters:
searchCriteria : str

The search criteria expressed in the ecu.test filter syntax. See section “Handling” => “Filter” of the ecu.test User Documentation.

useExtendedMode : boolean

If True, extended search strings are enabled. The default is False, meaning each word in the searchCriteria will be enclosed by wildcards and mapped to the filename. (e.g. “hello world” => “Name = ‘*hello*’ and Name = ‘*world*’”)

Returns:

All matching Global Mappings. If no file matches, an emtpy list is returned.

Return type:

list[GlobalMapping]

Raises:

ApiError – If the searchCriteria has an illegal syntax.