dataframe-textual 0.3.2__py3-none-any.whl → 1.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dataframe_textual/__init__.py +1 -2
- dataframe_textual/__main__.py +62 -14
- dataframe_textual/common.py +587 -92
- dataframe_textual/data_frame_help_panel.py +28 -8
- dataframe_textual/data_frame_table.py +2579 -704
- dataframe_textual/data_frame_viewer.py +215 -179
- dataframe_textual/sql_screen.py +202 -0
- dataframe_textual/table_screen.py +296 -100
- dataframe_textual/yes_no_screen.py +454 -165
- dataframe_textual-1.5.0.dist-info/METADATA +987 -0
- dataframe_textual-1.5.0.dist-info/RECORD +14 -0
- {dataframe_textual-0.3.2.dist-info → dataframe_textual-1.5.0.dist-info}/entry_points.txt +1 -0
- dataframe_textual-0.3.2.dist-info/METADATA +0 -548
- dataframe_textual-0.3.2.dist-info/RECORD +0 -13
- {dataframe_textual-0.3.2.dist-info → dataframe_textual-1.5.0.dist-info}/WHEEL +0 -0
- {dataframe_textual-0.3.2.dist-info → dataframe_textual-1.5.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from textwrap import dedent
|
|
4
4
|
|
|
5
|
+
from textual.app import ComposeResult
|
|
5
6
|
from textual.containers import VerticalScroll
|
|
6
7
|
from textual.css.query import NoMatches
|
|
7
8
|
from textual.widget import Widget
|
|
@@ -19,8 +20,8 @@ class DataFrameHelpPanel(Widget):
|
|
|
19
20
|
DataFrameHelpPanel {
|
|
20
21
|
split: right;
|
|
21
22
|
width: 33%;
|
|
22
|
-
min-width:
|
|
23
|
-
max-width:
|
|
23
|
+
min-width: 40;
|
|
24
|
+
max-width: 80;
|
|
24
25
|
border-left: vkey $foreground 30%;
|
|
25
26
|
padding: 0 1;
|
|
26
27
|
height: 1fr;
|
|
@@ -68,11 +69,22 @@ class DataFrameHelpPanel(Widget):
|
|
|
68
69
|
|
|
69
70
|
DEFAULT_CLASSES = "-textual-system"
|
|
70
71
|
|
|
71
|
-
def on_mount(self):
|
|
72
|
-
|
|
73
|
-
self.update_help(focused_widget)
|
|
72
|
+
def on_mount(self) -> None:
|
|
73
|
+
"""Set up help panel when mounted.
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Initializes the help panel by setting up a watcher for focused widget changes
|
|
76
|
+
to dynamically update help text based on which widget has focus.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
None
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
# def update_help(focused_widget: Widget | None):
|
|
83
|
+
# self.update_help(focused_widget)
|
|
84
|
+
|
|
85
|
+
# self.watch(self.screen, "focused", update_help)
|
|
86
|
+
|
|
87
|
+
self.update_help(self.screen.focused)
|
|
76
88
|
|
|
77
89
|
def update_help(self, focused_widget: Widget | None) -> None:
|
|
78
90
|
"""Update the help for the focused widget.
|
|
@@ -86,7 +98,7 @@ class DataFrameHelpPanel(Widget):
|
|
|
86
98
|
return
|
|
87
99
|
self.set_class(focused_widget is not None, "-show-help")
|
|
88
100
|
if focused_widget is not None:
|
|
89
|
-
help = self.app.HELP + "\n" + focused_widget.HELP or ""
|
|
101
|
+
help = (self.app.HELP or "") + "\n" + (focused_widget.HELP or "")
|
|
90
102
|
if not help:
|
|
91
103
|
self.remove_class("-show-help")
|
|
92
104
|
try:
|
|
@@ -94,5 +106,13 @@ class DataFrameHelpPanel(Widget):
|
|
|
94
106
|
except NoMatches:
|
|
95
107
|
pass
|
|
96
108
|
|
|
97
|
-
def compose(self):
|
|
109
|
+
def compose(self) -> ComposeResult:
|
|
110
|
+
"""Compose the help panel widget structure.
|
|
111
|
+
|
|
112
|
+
Creates and returns the widget hierarchy for the help panel,
|
|
113
|
+
including a VerticalScroll container with a Markdown display area.
|
|
114
|
+
|
|
115
|
+
Yields:
|
|
116
|
+
VerticalScroll: The main container with Markdown widget for help text.
|
|
117
|
+
"""
|
|
98
118
|
yield VerticalScroll(Markdown(id="widget-help"))
|