Skip to content

API turboframe.ui.icons

rafageist edited this page Dec 4, 2026 · 4 revisions

turboframe.ui.icons

Source: turboframe/ui/icons.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.

File marks for a file tree: one ASCII character, coloured by type.

A Turbo Vision screen is a grid of cells: a character the terminal draws two cells wide shifts the rest of its line and breaks the frames. So every mark is plain ASCII, the same width in every terminal, font and platform, and it goes in the blank cell files already have where folders show their ► ▼: the tree keeps its width. The plain style (PLAIN) leaves that cell blank.

A mark's colour is a slot (lightcyan...), so it follows the theme. The tables hold the kinds every application shares; an application adds its own with BY_EXTENSION.update({...}) and BY_NAME.update({...}).

Contents

BY_EXTENSION, BY_NAME, FILE, MARKS, MODES, PLAIN, mark_for

BY_EXTENSION

dict (12 entries)

BY_NAME

{'.gitignore': ('!', 'lightred'), 'LICENSE': ('c', 'lightgray')}

FILE

('-', 'lightgray')

MARKS

'marks'

MODES

('plain', 'marks')

PLAIN

'plain'

mark_for

def mark_for(path: Path, palette: themes.Palette | None = None) -> tuple[str, str]

(mark, colour) of a file, by its name, else its extension; the colour is the slot's #RRGGBB in the palette (the current one by default).

Clone this wiki locally