Functions#

getExistingDirectory(startWith='', caption='', dirOnly=True, resolveSymLinks=True)#

Pops up a file dialog to specify a list of names of files to read.

Parameters:
  • startWith (str) – File or Directory to start the selection.

  • caption (str) – Text displayed in the title bar.

  • dirOnly (bool) – Determines whether to show directories only.

  • resolveSymLinks (bool) – For Linux/Mac.

Returns:

The directory name.

Return type:

str

getExtensionManager()#

Returns the singleton instance of the Extension Manager.

getOpenFileName(startWith='', filter='', caption='', resolveSymLinks=True, remember=None, selectedFilter='', returnFilter=False, forget=None)#

Pops up a file dialog to specify a name of a file to read.

Parameters:
  • startWith (str) – File or Directory to start the selection.

  • filter (str) – Show only those files which match the filter. The filter is a string with a description followed by file extensions in parentheses. Multiple filters can be specified by separating them with double semicolons: filter = “Text files(.txt);;All Files(.*)”.

  • caption (str) – Text displayed in the title bar.

  • resolveSymLinks (bool) – For Linux/Mac.

  • remember ([type]) – Determines whether to remember the last directory the user navigated to.

  • selectedFilter (str) – The filter that is preselected.

  • returnFilter (bool) – Determines whether to return the chosen filter.

  • forget (signal object) – Upon emitting the signal, it clears the user’s previously accessed directory.

Returns:

The file name.

Return type:

str

getOpenFileNames(startWith='', filter='', caption='', resolveSymLinks=True, selectedFilter='', returnFilter=False)#

Pops up a file dialog to specify a list of names of files to read.

Parameters:
  • startWith (str) – File or Directory to start the selection.

  • filter (str) – Show only those files which match the filter. The filter is a string with a description followed by file extensions in parentheses. Multiple filters can be specified by separating them with double semicolons: filter = “Text files(.txt);;All Files(.*)”.

  • caption (str) – Text displayed in the title bar.

  • resolveSymLinks (bool) – For Linux/Mac.

  • selectedFilter (str) – The filter that is preselected.

  • returnFilter (bool) – Determines whether to return the chosen filter.

Returns:

The file name.

Return type:

str

getSaveFileName(startWith='', filter='', caption='', resolveSymLinks=True, confirmOverwrite=True, remember=None, selectedFilter='', returnFilter=False, forget=None)#

Pops up a file dialog to specify a name of a file to write.

Parameters:
  • startWith (str) – File or Directory to start the selection.

  • filter (str) – Show only those files which match the filter. The filter is a string with a description followed by file extensions in parentheses. Multiple filters can be specified by separating them with double semicolons: filter = “Text files(.txt);;All Files(.*)”.

  • caption (str) – Text displayed in the title bar.

  • resolveSymLinks (bool) – For Linux/Mac.

  • confirmOverwrite (bool) – Prompt the user when about to overwrite an existing file.

  • remember ([type]) – Determines whether to remember the last directory the user navigated to.

  • selectedFilter (str) – The filter that is preselected.

  • returnFilter (bool) – Determines whether to return the chosen filter.

  • forget (signal object) – Upon emitting the signal, it clears the user’s previously accessed directory.

Returns:

The file name.

Return type:

str

setStatusBarMessage(message, ms=None)#

Write a message to the status bar.

Parameters:
  • message (str) – message to be displayed.

  • ms (str) – milli-seconds value to be shown in the status bar, the message will be cleared after ms milli-seconds.

tellUser(message)#

Popup up the MessageDialog with information

Parameters:

message (str) – The information message to be displayed in the message dialog.

warnUser(message)#

Popup up the MessageDialog with a warning

Parameters:

message (str) – The warning message to be displayed in the message dialog.