euporie.notebook.tabs.json

Contain a tab for displaying JSON data.

Classes

Dimension([min, max, weight, preferred])

Specified dimension (width/height) of a user control or window.

JsonTab(app[, path])

Tab class for JSON data.

JsonView(data[, title, expanded])

A JSON-view container.

MarginContainer(margin, target)

A container which renders a stand-alone margin.

ScrollbarMargin([display_arrows, ...])

Margin displaying a scrollbar.

ScrollingContainer(children[, height, ...])

A scrollable container which renders only the currently visible children.

Tab(app[, path])

Base class for interface tabs.

VSplit(children[, window_too_small, align, ...])

Several layouts, one stacked left/right of the other.

class euporie.notebook.tabs.json.JsonTab(app: BaseApp, path: Path | None = None)

Bases: Tab

Tab class for JSON data.

close(cb: Callable | None = None) None

Close a tab with a callback.

Parameters:

cb – A function to call after the tab is closed.

container: AnyContainer
file_extensions: ClassVar[dict[str, None]] = {}
file_types: ClassVar[dict[str, None]] = {'.json': None}
focus() None

Focus the tab (or make it visible).

load_container() AnyContainer

Abcract method for loading the notebook’s main container.

mime_types: ClassVar[set[str]] = {'*json'}
name: str | None = 'JSON Viewer'
reset() None

Reset the state of the tab.

save(path: Path | None = None, cb: Callable | None = None) None

Save the current file.

property title: str

Return the tab title.

weight: int = 0
write_file(path: Path) None

Write the tab’s data to a path.

Not implement in the base tab.

Parameters:

path – An path at which to save the file