visualdynamics.gui.console¶
console
¶
The console: the session as Python, along the bottom of the window.
A tab on the bottom edge of the views opens and closes it: click it to
expand the console and click again to collapse it. It shows
project.journal, every verb and settings change of this session as
the line of Python that replays it. The text is read-only and can be
selected and copied, so a session done in the window can be copied
into a script, and a user who does not want the Python never has to
open it.
Classes:
| Name | Description |
|---|---|
ConsolePanel |
The scrollback, and the tab that floats over the edge of the |
Functions:
| Name | Description |
|---|---|
elided |
A journal line as the console shows it: whole up to |
Classes¶
ConsolePanel
¶
Bases: QWidget
The scrollback, and the tab that floats over the edge of the views.
The panel holds only the scrollback, so collapsed it is zero pixels
tall. The tab is not in any layout: float_over places it on the
bottom edge of the widget the console expands under, the way a
handle sits on a drawer, and moves it when that widget is resized.
Qt has nothing built in for this (its tab widgets are document tabs,
and the native macOS drawer is deprecated), so the tab is placed by
hand.
Methods:
| Name | Description |
|---|---|
float_over |
Place the tab on |
refresh |
Bring the scrollback up to date with the session's journal. |
Attributes:
| Name | Type | Description |
|---|---|---|
showing |
bool
|
Whether the scrollback is expanded. |
Source code in src/visualdynamics/gui/console.py
Attributes¶
Methods:¶
float_over
¶
Place the tab on host's bottom edge, centered, and keep it
there when host is resized.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
QWidget
|
A plain container that holds the views and this panel; the tab sits on the drawer's top edge like a handle. It must not be a QSplitter, because a splitter makes any child widget a new pane, and the tab would become a third pane at the right edge. |
required |
Source code in src/visualdynamics/gui/console.py
refresh
¶
Bring the scrollback up to date with the session's journal.
When nothing changed this is one tuple comparison. When something
did, the text is rewritten in full, because the journal may edit
its own last line (a drag settles to one line) and a view that
only appended would keep the line that was replaced. Lines longer
than SHOWN_CHARACTERS are shortened, as elided says.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
journal
|
list of str
|
The project's session journal, shown as written. |
required |
Source code in src/visualdynamics/gui/console.py
Functions:¶
elided
¶
A journal line as the console shows it: whole up to
SHOWN_CHARACTERS characters, and otherwise its first
SHOWN_CHARACTERS characters followed by the line's full length.