traitsui.editors.file_editor module

Defines the file editor factory for all traits toolkit backends.

class traitsui.editors.file_editor.FileEditor(*args, **traits)[source]

Bases: TextEditor

Editor factory for file editors.

allow_dir = Bool(False)

Can the user select directories as well as files?

auto_set = False

Is user input set on every keystroke? (Overrides the default) (‘simple’ style only):

dclick_name = Str()

Optional extended trait name used to notify when the user double-clicks an entry in the file tree view. The associated path is assigned it:

dialog_style = Str("open")

The style of file dialog to use when the ‘Browse…’ button is clicked Should be one of ‘open’ or ‘save’

enter_set = True

Is user input set when the Enter key is pressed? (Overrides the default) (‘simple’ style only):

entries = Int(10)

The number of history entries to maintain: FIXME: This is currently only supported on wx. Qt support needs to be added

filter = filter_trait

Wildcard filter to apply to the file dialog:

filter_name = Str()

Optional extended trait name of the trait containing the list of filters:

reload_name = Str()

Optional extended trait name used to notify the editor when the file system view should be reloaded (‘custom’ style only):

root_path = File()

The root path of the file tree view (‘custom’ style only, not supported under wx). If not specified, the filesystem root is used.

root_path_name = Str()

Optional extend trait name of the trait containing the root path.

truncate_ext = Bool(False)

Should file extension be truncated?

traitsui.editors.file_editor.ToolkitEditorFactory

alias of FileEditor

traitsui.editors.file_editor.filter_trait = List(Str)

Wildcard filter: