fmeobjects.FMEDialog

Inheritance diagram of fmeobjects.FMEDialog

FMEDialog.about

about(applicationName),

FMEDialog.coordSysPrompt

coordSysPrompt(coordSysName),

FMEDialog.destPrompt(defaultDestFormat, ...)

This method displays a dialog to prompt the user to choose a destination format and dataset.

FMEDialog.featTypeProperties(format, source, ...)

Bring up the feature type properties dialog on the given schema feature.

FMEDialog.generate

generate(defaultSourceDataset),

FMEDialog.guessFormat

guessFormat(filename),

FMEDialog.parameterPrompt

parameterPrompt(filename),

FMEDialog.sourcePrompt(defaultSourceFormat, ...)

This method displays a dialog to prompt the user to choose a source format and dataset.

FMEDialog.xlatePrompt(defaultSourceFormat, ...)

This method displays a dialog to prompt the user to choose a source format and dataset.

class FMEDialog

FME Dialog Class

init()

Provides access to the standard FME dialog boxes.

__init__(*args, **kwargs)
about()

about(applicationName),

This method displays a dialog box that shows the kind of FME license and FME build number that the FMEObjects application is using.

Parameters:

applicationName (str) – The name of the application that will appear in the dialog.

Returns:

None

coordSysPrompt()

coordSysPrompt(coordSysName),

This method displays a standard FME coordinate system dialog to prompt the user to choose a coordinate system.

Parameters:

coordSysName (str) – (Optional) the default coordinate system to be highlighted when the dialog is opened.

Return type:

str or None

Returns:

The coordinate system chose by the user, if cancel was pressed None is returned.

destPrompt(defaultDestFormat, defaultDestDataset, userDirectives)

This method displays a dialog to prompt the user to choose a destination format and dataset.

Parameters:
  • defaultDestFormat (str) – The default format that will be selected when the dialog is opened. If none is desired, then this should be a 0 length str.

  • defaultDestDataset (str) – The default dataset that will appear when the dialog is opened. If none is desired, then this should be a 0 length str.

  • userDirectives (dict or list[str]) –

    (Optional) Specify one or more additional directives to be used by the dialog. All elements in this collection must be strings. A list should be used if one key is to be set to multiple values. If a list is passed in, key-value pairs such as those in a dict must be placed side by side. For example, the key should be placed in the first list element, followed by the value for the key. These user directives are honoured:

    • TITLE: The title to be used in the dialog box.

    • LIMIT_FORMATS: The short names of the only formats that will be allowed, separated by | characters.

    • EXCLUDE_FORMATS: The short names of the formats that will NOT be allowed, separated by | characters. Exclude takes precedence over LIMIT_FORMATS.

    • SETTINGS_ONLY: If value is “yes”, then the settings box is shown for the passed in default destination format/dataset The default is “no”.

    • SPATIAL_SETTINGS If value is “yes”, then any settings box that allows for specifying spatial constraints will have that aspect remain enabled. The default is”yes”. If the value is “no”, then the spatial area specification aspect of the settings boxes is disabled. This directive is useful for disabling spatial settings when a source dialog is done only for the purpose of gathering schema information.

Return type:

tuple[str, str, list[str]] or None

Returns:

The destination format and dataset along with the user directives, these can be used directly with the FMEUniversalWriter. This tuple is formatted (destFormat, destDataset, [directives]). None is returned if the user pressed Cancel. The directives returned are as follows:

  • RUNTIME_MACROS: The runtime macros are in the next position.

  • META_MACROS: The metafile macros are in the next position.

  • METAFILE: The metafile name is in the next position.

  • COORDSYS: The coordinate system is in the next position.

featTypeProperties(format, source, schemaFeat)

Bring up the feature type properties dialog on the given schema feature.

Parameters:
  • format (str) – The format name for the format this schema feature is a part of.

  • source (bool) – True if this feature type is a source, False otherwise.

  • schemaFeat (FMEFeature) –

    The schema feature to edit. The schema feature is represented through the following values on the feature:

    • Feature Type: The feature type of the schema feature.

    • Geometry Type: The geometry type(s) of the schema feature, set as the ‘fme_geometry{n}’ attribute on the schema feature, where n is an index starting at 0. The geometry type values are the format specific geometry types that are defined in the metafile of the target format.

    • User Attributes: The user attribute(s) of the schema feature, set as regular attribute name/type pairs on the schema feature.

    • Format Attributes: The format attribute(s) of the schema feature, set as ‘fme_format_attr_name{n}’ and ‘fme_format_attr_type{n}’ attributes on the schema feature, where n is an index starting at 0.

Return type:

FMEFeature or None

Returns:

The schema feature that has been edited, None otherwise.

generate()

generate(defaultSourceDataset),

This method displays the Generate Workspace dialog box.

Parameters:

defaultSourceDataset (str) – The default source dataset displayed in the Generate Workspace dialog.

Return type:

tuple[str]

Returns:

The parameter filename and workspace filename. This tuple is formatted: (parameterFileName, workspaceFileName). Returns None if the user hit cancel.The parameterFileName that is returned can be used to generate a workspace with this fme invocation:fme PARAMETER_FILE < parameterFile > Then the parameterFile should be deleted from the disk. The workspace itself will not exist until after the FME returns.

guessFormat()

guessFormat(filename),

This method attempts to guess the format based on the extension of the filename passed in.

Parameters:

filename (str) – The name of the file.

Return type:

str or None

Returns:

The format guessed or None if we were unable to make a guess.

parameterPrompt()

parameterPrompt(filename),

This method is deprecated as of FME 2022.1.

This method parses the file with the passed in name and does a standard FME dialog for the parameters listed in the GUI lines in the file. If any DEFAULT_MACRO lines were found, these supply default values. If the user exits the form with OK, then the file will be overwritten with a new file that alternates MACRO NAME and VALUE, line by line.

Parameters:

filename (str) – The name of the file to be parsed.

Return type:

bool

Returns:

True is returned if the user has pressed OK, False otherwise.

sourcePrompt(defaultSourceFormat, defaultSourceDataset, userDirectives)

This method displays a dialog to prompt the user to choose a source format and dataset.

Parameters:
  • defaultSourceFormat (str) – The default format that will be selected when the dialog is opened. If none is desired, then this should be a 0 length str.

  • defaultSourceDataset (str) – The default dataset that will appear when the dialog is opened. If none is desired, then this should be a 0 length str.

  • userDirectives (dict or list[str]) –

    (Optional) Specify one or more additional directives to be used by the dialog. All elements in this collection must be strings. A list should be used if one key is to be set to multiple values. If a list is passed in, key-value pairs such as those in a dict must be placed side by side. For example, the key should be placed in the first list element, followed by the value for the key. These user directives are honoured:

    • TITLE: The title to be used in the dialog box.

    • LIMIT_FORMATS: The short names of the only formats that will be allowed, separated by | characters.

    • EXCLUDE_FORMATS The short names of the formats that will NOT be allowed, separated by | characters. Exclude takes precedence over LIMIT_FORMATS.

    • SETTINGS_ONLY: If value is “yes”, then the settings box is shown for the passed in default destination format/dataset The default is “no”.

    • SPATIAL_SETTINGS If value is “yes”, then any settings box that allows for specifying spatial constraints will have that aspect remain enabled. The default is”yes”. If the value is “no”, then the spatial area specification aspect of the settings boxes is disabled. This directive is useful for disabling spatial settings when a source dialog is done only for the purpose of gathering schema information.

Return type:

tuple[str, str, list[str]] or None

Returns:

The source format and dataset along with the user directives, these can be used directly with the FMEUniversalReader. This tuple is formated (sourceFormat, sourceDataset, [directives]). None is returned if the user pressed Cancel. The directives returned are as follows:

  • RUNTIME_MACROS: The runtime macros are in the next position.

  • META_MACROS: The metafile macros are in the next position.

  • METAFILE: The metafile name is in the next position.

  • COORDSYS: The coordinate system is in the next position.

  • IDLIST: The id list is in the next position.

xlatePrompt(defaultSourceFormat, defaultSourceDataset, defaultDestFormat, defaultDestDataset, userDirectives)

This method displays a dialog to prompt the user to choose a source format and dataset.

Parameters:
  • defaultSourceFormat (str) – The default source format that will be selected when the dialog is opened. If none is desired, then this should be a 0 length string.

  • defaultSourceDataset (str) – The default source dataset that will appear when the dialog is opened. If none is desired, then this should be a 0 length string.

  • defaultDestFormat (str) – The default destination format that will be selected when the dialog is opened. If none is desired, then this should be a 0 length string.

  • defaultDestDataset (str) – The default destination dataset that will appear when the dialog is opened. If none is desired, then this should be a 0 length string.

  • userDirectives (dict or list[str]) –

    (Optional) Specify one or more additional directives to be used by the dialog. All elements in this collection must be strings. A list should be used if one key is to be set to multiple values. If a list is passed in, key-value pairs such as those in a dict must be placed side by side. For example, the key should be placed in the first list element, followed by the value for the key. These user directives are honoured:

    • TITLE: The title to be used in the dialog box.

    • LIMIT_FORMATS: The short names of the only formats that will be allowed, separated by | characters.

    • SPATIAL_SETTINGS: If value is “yes”, then any settings box that allows for specifying spatial constraints will have that aspect remain enabled. The default is”yes”. If the value is “no”, then the spatial area specification aspect of the settings boxes is disabled. This directive is useful for disabling spatial settings when a source dialog is done only for the purpose of gathering schema information.

Return type:

tuple[str, str, str, str, list[str], list[str]] or None

Returns:

The source format, source dataset, destination format, and destination dataset along with the source user directives and destination user directives, these can be used directly with the FMEUniversalReader and FMEUniversalWriter respectively. This tuple is formated (sourceFormat, sourceDataset, destFormat, destDataset, [sourceUserDirectives], [destUserDirectives]). None is returned if the user pressed Cancel. The source user directives returned are as follows:

  • RUNTIME_MACROS: The runtime macros are in the next position.

  • META_MACROS: The metafile macros are in the next position.

  • METAFILE: The metafile name is in the next position.

  • COORDSYS: The coordinate system is in the next position.

  • IDLIST: The id list is in the next position.

The destination user directives returned are as follows:`

  • RUNTIME_MACROS: The runtime macros are in the next position.

  • META_MACROS: The metafile macros are in the next position.

  • METAFILE: The metafile name is in the next position.

  • COORDSYS: The coordinate system is in the next position.