openairclim.gui.components.file_picker

File/folder picker component: text input + native browse dialog.

class openairclim.gui.components.file_picker.FilePicker(*, description, directory, file_types, label, path, placeholder, name)[source]

Bases: Viewer

A picker with a text field, browse button, and status indicator.

Parameters:
  • label (str) – Display label shown above the text input.

  • file_types (list) – File type filters for the browse dialog.

  • directory (bool) – If True, browse for a folder instead of a file.

  • path (str) – Currently selected path (readable and watchable).

  • placeholder (str, optional) – Placeholder text shown in the text input when empty. Defaults to a generic “enter a path…” hint; pass this to say something more specific instead (e.g. what an empty value means for that particular field).

description = None
directory = False
file_types = [('All files', '*.*')]
label = 'File'
name = 'FilePicker'
path = ''
placeholder = None
set_path(value: str) None[source]

Programmatically set the selected path. Updates the text input, which in turn syncs self.path and the status indicator via the existing _on_text_changed watcher.