vimsheet.app

VimSheet Textual application.

class vimsheet.app.VimSheetApp(workbook=None, config=None, **kwargs)[source]

Bases: App[None]

Main VimSheet application.

Parameters:
  • workbook (Workbook | None)

  • config (Any)

  • kwargs (Any)

CSS = '\n    Screen { layout: vertical; }\n    '

Inline CSS, useful for quick scripts. This is loaded after CSS_PATH, and therefore takes priority in the event of a specificity clash.

__init__(workbook=None, config=None, **kwargs)[source]

Create an instance of an app.

Parameters:
  • driver_class – Driver class or None to auto-detect. This will be used by some Textual tools.

  • css_path – Path to CSS or None to use the CSS_PATH class variable. To load multiple CSS files, pass a list of strings or paths which will be loaded in order.

  • watch_css – Reload CSS if the files changed. This is set automatically if you are using textual run with the dev switch.

  • ansi_color – Allow ANSI colors if True, or convert ANSI colors to RGB if False, None to use “ansi” parameter from themes.

  • workbook (Workbook | None)

  • config (Any)

  • kwargs (Any)

Raises:

CssPathError – When the supplied CSS path(s) are an unexpected type.

Return type:

None

compose()[source]

Yield child widgets for a container.

This method should be implemented in a subclass.

Return type:

Iterable[Widget]

on_mount()[source]
Return type:

None

on_unmount()[source]
Return type:

None

property grid: GridWidget
property formula_bar: FormulaBar
property status_bar: StatusBar
property sheet_tabs: SheetTabs
property mode: Mode
property cursor_row: int
property cursor_col: int
property cursor: tuple[int, int]
on_key(event)[source]

Route all key events through the active mode handler.

Parameters:

event (Any)

Return type:

None

open_in_external_editor()[source]

Open current cell content in $EDITOR, then write back on save.

Return type:

None

on_grid_widget_cursor_moved(message)[source]
Parameters:

message (CursorMoved)

Return type:

None

on_sheet_tabs_sheet_selected(message)[source]
Parameters:

message (SheetSelected)

Return type:

None

on_sheet_tabs_add_sheet(_message)[source]
Parameters:

_message (AddSheet)

Return type:

None