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

Class FMEDialog


init()

FME Dialog class.

Provides access to the standard FME dialog boxes.

Instance Methods [hide private]
 
__init__()
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
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.
string or None
coordSysPrompt(coordSysName)
This method displays a standard FME coordinate system dialog to prompt the user to choose a coordinate system.
tuple of strings and list of strings or None
destPrompt(defaultDestFormat, defaultDestDataset, userDirectives)
This method displays a dialog to prompt the user to choose a destination format and dataset.
FMEFeature or None
featTypeProperties(format, source, schemaFeat)
Bring up the feature type properties dialog on the given schema feature.
tuple of strings
generate(defaultSourceDataset)
This method displays the Generate Workspace dialog box.
string or None
guessFormat(filename)
This method attempts to guess the format based on the extension of the filename passed in.
bool
parameterPrompt(filename)
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.
tuple of strings and list of strings or None
sourcePrompt(defaultSourceFormat, defaultSourceDataset, userDirectives)
This method displays a dialog to prompt the user to choose a source format and dataset.
tuple of strings and list of strings or None
xlatePrompt(defaultSourceFormat, defaultSourceDataset, defaultDestFormat, defaultDestDataset, userDirectives)
This method displays a dialog to prompt the user to choose a source format and dataset.

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__()
(Constructor)

 

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

Overrides: object.__init__

__new__(T, S, ...)

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

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 (string) - The name of the application that will appear in the dialog.
Returns:
None

coordSysPrompt(coordSysName)

 

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

Parameters:
  • coordSysName (string) - (Optional) the default coordinate system to be highlighted when the dialog is opened
Returns: string or None
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 (string) - The default format that will be selected when the dialog is opened. If none is desired, then this should be a 0 length string.
  • defaultDestDataset (string) - The default 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 of strings) - (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.
    
Returns: tuple of strings and list of strings or None
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 (string) - 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.

Returns: FMEFeature or None
The schema feature that has been edited, None otherwise.

generate(defaultSourceDataset)

 

This method displays the Generate Workspace dialog box.

Parameters:
  • defaultSourceDataset (string) - The default source dataset displayed in the Generate Workspace dialog.
Returns: tuple of strings
The parameter filename and workspace filename. This tuple is formatted: (parameterFileName, workspaceFileName). Returnes 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(filename)

 

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

Parameters:
  • filename (string) - The name of the file.
Returns: string or None
The format guessed or None if we were unable to make a guess.

parameterPrompt(filename)

 

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 (string) - The name of the file to be parsed.
Returns: bool
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 (string) - The default format that will be selected when the dialog is opened. If none is desired, then this should be a 0 length string.
  • defaultSourceDataset (string) - The default 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 of strings) - (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.
    
Returns: tuple of strings and list of strings or None
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 (string) - 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 (string) - 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 (string) - 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 (string) - 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 of strings) - (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.
    
Returns: tuple of strings and list of strings or None
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.