FileChooser

New in version 1.0.5.

Warning

This is experimental and subject to change as long as this warning notice is present.

Changed in version 1.2.0.

class kivy.uix.filechooser.FileChooserListView(**kwargs)

Bases: kivy.uix.filechooser.FileChooserController

Implementation of FileChooserController using a list view

class kivy.uix.filechooser.FileChooserIconView(**kwargs)

Bases: kivy.uix.filechooser.FileChooserController

Implementation of FileChooserController using an icon view

class kivy.uix.filechooser.FileChooserController(**kwargs)

Bases: kivy.uix.floatlayout.FloatLayout

Base for implementing a FileChooser. Don’t use that class directly, prefer to use one implementation like FileChooserListView or FileChooserIconView.

cancel(*largs)

Cancel any background action started by filechooser, like loading a new directory.

New in version 1.2.0.

dirselect

BooleanProperty, defaults to False. Determines whether directories are valid selections.

New in version 1.1.0.

entry_released(entry, touch)

(internal) This method must be called by the template when an entry is touched by the user.

New in version 1.1.0.

entry_touched(entry, touch)

(internal) This method must be called by the template when an entry is touched by the user.

file_encodings

Possible encodings for decoding a filename to unicode. It might be possible than user have a weird filename, undecodable without knowing it’s initial encoding. We have no other choice to guess it.

Please note that if you encounter an issue cause of a missing encodings here, we’ll be glad to add it in this list.

New in version 1.3.0.

ListProperty, defaults to [‘utf-8’, ‘latin1’, ‘cp1252’]

files

Read-only ListProperty. The list of files in the directory specified by path after applying the filters.

filter_dirs

BooleanProperty, defaults to False. Indicate whether filters should also apply to directories.

filters

ListProperty, defaults to [], equal to ‘*’. The filters to be applied to the files in the directory, e.g. [‘*.png’]. The filters are not reset when the path changes, you need to do that yourself if you want that. You can use the following patterns:

Pattern Meaning
* matches everything
? matches any single character
[seq] matches any character in seq
[!seq] matches any character not in seq
get_nice_size(fn)

Pass the filepath. Returns the size in the best human readable format or ‘’ if it’s a directory (Don’t recursively calculate size.).

multiselect

BooleanProperty, defaults to False. Determines whether user is able to select multiple files.

path

StringProperty, defaults to current working directory as unicode string. Specifies the path on the filesystem that this controller should look at.

progress_cls

Class to use for display a progression of the filechooser loading.

New in version 1.2.0.

ObjectProperty, defaults to FileChooserProgress

rootpath

Root path to use, instead of the system root path. If set, it will not show a ”..” directory to go upper the root path. For example, if you set rootpath to /Users/foo, the user will be unable to goes to /Users, or any other directory not starting with /Users/foo.

New in version 1.2.0.

StringProperty, defaults to None.

selection

Read-only ListProperty. The list of files that are currently selected.

show_hidden

BooleanProperty, defaults to False. Determines whether hidden files and folders should be shown.

sort_func

ObjectProperty. Provide a function to be called with a list of filenames as only argument. Return a list of filenames in such a manner that the new list is sorted and represents in which order files are supposed to be displayed in the view.

class kivy.uix.filechooser.FileChooserProgressBase(**kwargs)

Bases: kivy.uix.floatlayout.FloatLayout

Base for implementing a progress view. This view is used when too many entries need to be created, and are delayed over multiple frames.

New in version 1.2.0.

cancel(*largs)

Cancel any action from the FileChooserController

index

Current index of total entries to be loaded

path

Current path of the FileChooser, read-only

total

Total number of entries to load