omdev 0.0.0.dev440__py3-none-any.whl → 0.0.0.dev495__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.
Potentially problematic release.
This version of omdev might be problematic. Click here for more details.
- omdev/.omlish-manifests.json +18 -30
- omdev/README.md +51 -0
- omdev/__about__.py +11 -7
- omdev/amalg/gen/gen.py +49 -6
- omdev/amalg/gen/imports.py +1 -1
- omdev/amalg/gen/manifests.py +1 -1
- omdev/amalg/gen/resources.py +1 -1
- omdev/amalg/gen/srcfiles.py +13 -3
- omdev/amalg/gen/strip.py +1 -1
- omdev/amalg/gen/types.py +1 -1
- omdev/amalg/gen/typing.py +1 -1
- omdev/amalg/info.py +32 -0
- omdev/cache/data/actions.py +1 -1
- omdev/cache/data/specs.py +1 -1
- omdev/cexts/_boilerplate.cc +2 -3
- omdev/cexts/cmake.py +4 -1
- omdev/ci/cli.py +2 -3
- omdev/cli/clicli.py +37 -7
- omdev/cmdlog/cli.py +1 -2
- omdev/dataclasses/_dumping.py +1960 -0
- omdev/dataclasses/_template.py +22 -0
- omdev/dataclasses/cli.py +7 -2
- omdev/dataclasses/codegen.py +340 -60
- omdev/dataclasses/dumping.py +200 -0
- omdev/interp/cli.py +1 -1
- omdev/interp/types.py +3 -2
- omdev/interp/uv/provider.py +37 -0
- omdev/interp/venvs.py +1 -0
- omdev/irc/messages/base.py +50 -0
- omdev/irc/messages/formats.py +92 -0
- omdev/irc/messages/messages.py +775 -0
- omdev/irc/messages/parsing.py +99 -0
- omdev/irc/numerics/__init__.py +0 -0
- omdev/irc/numerics/formats.py +97 -0
- omdev/irc/numerics/numerics.py +865 -0
- omdev/irc/numerics/types.py +59 -0
- omdev/irc/protocol/LICENSE +11 -0
- omdev/irc/protocol/__init__.py +61 -0
- omdev/irc/protocol/consts.py +6 -0
- omdev/irc/protocol/errors.py +30 -0
- omdev/irc/protocol/message.py +21 -0
- omdev/irc/protocol/nuh.py +55 -0
- omdev/irc/protocol/parsing.py +158 -0
- omdev/irc/protocol/rendering.py +153 -0
- omdev/irc/protocol/tags.py +102 -0
- omdev/irc/protocol/utils.py +30 -0
- omdev/manifests/_dumping.py +125 -25
- omdev/manifests/main.py +1 -1
- omdev/markdown/__init__.py +0 -0
- omdev/markdown/incparse.py +116 -0
- omdev/markdown/tokens.py +51 -0
- omdev/packaging/marshal.py +8 -8
- omdev/packaging/requires.py +6 -6
- omdev/packaging/revisions.py +1 -1
- omdev/packaging/specifiers.py +2 -1
- omdev/packaging/versions.py +4 -4
- omdev/packaging/wheelfile.py +2 -0
- omdev/precheck/blanklines.py +66 -0
- omdev/precheck/caches.py +1 -1
- omdev/precheck/imports.py +14 -1
- omdev/precheck/main.py +4 -3
- omdev/precheck/unicode.py +39 -15
- omdev/py/asts/__init__.py +0 -0
- omdev/py/asts/parents.py +28 -0
- omdev/py/asts/toplevel.py +123 -0
- omdev/py/asts/visitors.py +18 -0
- omdev/py/attrdocs.py +1 -1
- omdev/py/bracepy.py +12 -4
- omdev/py/reprs.py +32 -0
- omdev/py/srcheaders.py +1 -1
- omdev/py/tokens/__init__.py +0 -0
- omdev/py/tools/mkrelimp.py +1 -1
- omdev/py/tools/pipdepup.py +686 -0
- omdev/pyproject/cli.py +1 -1
- omdev/pyproject/pkg.py +190 -45
- omdev/pyproject/reqs.py +31 -9
- omdev/pyproject/tools/__init__.py +0 -0
- omdev/pyproject/tools/aboutdeps.py +60 -0
- omdev/pyproject/venvs.py +8 -1
- omdev/rs/__init__.py +0 -0
- omdev/scripts/ci.py +752 -98
- omdev/scripts/interp.py +232 -39
- omdev/scripts/lib/inject.py +74 -27
- omdev/scripts/lib/logs.py +187 -43
- omdev/scripts/lib/marshal.py +67 -25
- omdev/scripts/pyproject.py +1369 -143
- omdev/tools/git/cli.py +10 -0
- omdev/tools/json/formats.py +2 -0
- omdev/tools/json/processing.py +5 -2
- omdev/tools/jsonview/cli.py +49 -65
- omdev/tools/jsonview/resources/jsonview.html.j2 +43 -0
- omdev/tools/pawk/README.md +195 -0
- omdev/tools/pawk/pawk.py +2 -2
- omdev/tools/pip.py +8 -0
- omdev/tui/__init__.py +0 -0
- omdev/tui/apps/__init__.py +0 -0
- omdev/tui/apps/edit/__init__.py +0 -0
- omdev/tui/apps/edit/main.py +167 -0
- omdev/tui/apps/irc/__init__.py +0 -0
- omdev/tui/apps/irc/__main__.py +4 -0
- omdev/tui/apps/irc/app.py +286 -0
- omdev/tui/apps/irc/client.py +187 -0
- omdev/tui/apps/irc/commands.py +175 -0
- omdev/tui/apps/irc/main.py +26 -0
- omdev/tui/apps/markdown/__init__.py +0 -0
- omdev/tui/apps/markdown/__main__.py +11 -0
- omdev/{ptk → tui/apps}/markdown/cli.py +5 -7
- omdev/tui/rich/__init__.py +46 -0
- omdev/tui/rich/console2.py +20 -0
- omdev/tui/rich/markdown2.py +186 -0
- omdev/tui/textual/__init__.py +265 -0
- omdev/tui/textual/app2.py +16 -0
- omdev/tui/textual/autocomplete/LICENSE +21 -0
- omdev/tui/textual/autocomplete/__init__.py +33 -0
- omdev/tui/textual/autocomplete/matching.py +226 -0
- omdev/tui/textual/autocomplete/paths.py +202 -0
- omdev/tui/textual/autocomplete/widget.py +612 -0
- omdev/tui/textual/debug/__init__.py +10 -0
- omdev/tui/textual/debug/dominfo.py +151 -0
- omdev/tui/textual/debug/screen.py +24 -0
- omdev/tui/textual/devtools.py +187 -0
- omdev/tui/textual/drivers2.py +55 -0
- omdev/tui/textual/logging2.py +20 -0
- omdev/tui/textual/types.py +45 -0
- {omdev-0.0.0.dev440.dist-info → omdev-0.0.0.dev495.dist-info}/METADATA +15 -9
- {omdev-0.0.0.dev440.dist-info → omdev-0.0.0.dev495.dist-info}/RECORD +135 -80
- omdev/ptk/__init__.py +0 -103
- omdev/ptk/apps/ncdu.py +0 -167
- omdev/ptk/confirm.py +0 -60
- omdev/ptk/markdown/LICENSE +0 -22
- omdev/ptk/markdown/__init__.py +0 -10
- omdev/ptk/markdown/__main__.py +0 -11
- omdev/ptk/markdown/border.py +0 -94
- omdev/ptk/markdown/markdown.py +0 -390
- omdev/ptk/markdown/parser.py +0 -42
- omdev/ptk/markdown/styles.py +0 -29
- omdev/ptk/markdown/tags.py +0 -299
- omdev/ptk/markdown/utils.py +0 -366
- omdev/pyproject/cexts.py +0 -110
- /omdev/{ptk/apps → irc}/__init__.py +0 -0
- /omdev/{tokens → irc/messages}/__init__.py +0 -0
- /omdev/{tokens → py/tokens}/all.py +0 -0
- /omdev/{tokens → py/tokens}/tokenizert.py +0 -0
- /omdev/{tokens → py/tokens}/utils.py +0 -0
- {omdev-0.0.0.dev440.dist-info → omdev-0.0.0.dev495.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev440.dist-info → omdev-0.0.0.dev495.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev440.dist-info → omdev-0.0.0.dev495.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev440.dist-info → omdev-0.0.0.dev495.dist-info}/top_level.txt +0 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import sys
|
|
3
3
|
|
|
4
|
-
from ... import
|
|
5
|
-
from .markdown import Markdown
|
|
6
|
-
from .styles import MARKDOWN_STYLE
|
|
4
|
+
from ... import rich
|
|
7
5
|
|
|
8
6
|
|
|
9
7
|
##
|
|
@@ -20,10 +18,10 @@ def _main() -> None:
|
|
|
20
18
|
else:
|
|
21
19
|
src = sys.stdin.read()
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
21
|
+
console = rich.Console()
|
|
22
|
+
markdown = rich.Markdown(src)
|
|
23
|
+
console.print(markdown)
|
|
24
|
+
print()
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
if __name__ == '__main__':
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# ruff: noqa: F401
|
|
2
|
+
# flake8: noqa: F401
|
|
3
|
+
from omlish import lang as _lang
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
with _lang.auto_proxy_init(globals()):
|
|
7
|
+
##
|
|
8
|
+
|
|
9
|
+
from rich import align # noqa
|
|
10
|
+
from rich import console # noqa
|
|
11
|
+
from rich import live # noqa
|
|
12
|
+
from rich import markdown # noqa
|
|
13
|
+
from rich import repr # noqa
|
|
14
|
+
from rich import text # noqa
|
|
15
|
+
from rich.align import Align # noqa
|
|
16
|
+
from rich.color import Color # noqa
|
|
17
|
+
from rich.color import blend_rgb # noqa
|
|
18
|
+
from rich.color_triplet import ColorTriplet # noqa
|
|
19
|
+
from rich.console import Console # noqa
|
|
20
|
+
from rich.console import Group # noqa
|
|
21
|
+
from rich.live import Live # noqa
|
|
22
|
+
from rich.markdown import Markdown # noqa
|
|
23
|
+
from rich.segment import Segment # noqa
|
|
24
|
+
from rich.segment import SegmentLines # noqa
|
|
25
|
+
from rich.style import Style # noqa
|
|
26
|
+
from rich.syntax import Syntax # noqa
|
|
27
|
+
from rich.table import Table # noqa
|
|
28
|
+
from rich.text import Text # noqa
|
|
29
|
+
from rich.theme import Theme # noqa
|
|
30
|
+
|
|
31
|
+
##
|
|
32
|
+
|
|
33
|
+
from .console2 import ( # noqa
|
|
34
|
+
console_render,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
from .markdown2 import ( # noqa
|
|
38
|
+
configure_markdown_parser,
|
|
39
|
+
markdown_from_tokens,
|
|
40
|
+
flatten_tokens_filter,
|
|
41
|
+
flatten_tokens,
|
|
42
|
+
|
|
43
|
+
MarkdownLiveStream,
|
|
44
|
+
NaiveMarkdownLiveStream,
|
|
45
|
+
IncrementalMarkdownLiveStream,
|
|
46
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import io
|
|
2
|
+
import typing as ta
|
|
3
|
+
|
|
4
|
+
from omlish import lang
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
with lang.auto_proxy_import(globals()):
|
|
8
|
+
import rich.console
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
##
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def console_render(obj: ta.Any, **kwargs: ta.Any) -> str:
|
|
15
|
+
temp_console = rich.console.Console(
|
|
16
|
+
file=(out := io.StringIO()),
|
|
17
|
+
**kwargs,
|
|
18
|
+
)
|
|
19
|
+
temp_console.print(obj)
|
|
20
|
+
return out.getvalue()
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
import typing as ta
|
|
3
|
+
|
|
4
|
+
from omlish import lang
|
|
5
|
+
|
|
6
|
+
from ...markdown.incparse import IncrementalMarkdownParser
|
|
7
|
+
from ...markdown.tokens import flatten_tokens as _flatten_tokens
|
|
8
|
+
from .console2 import console_render
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
with lang.auto_proxy_import(globals()):
|
|
12
|
+
import markdown_it as md # noqa
|
|
13
|
+
import markdown_it.token # noqa
|
|
14
|
+
import rich.console
|
|
15
|
+
import rich.live
|
|
16
|
+
import rich.markdown
|
|
17
|
+
import rich.text
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
##
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def configure_markdown_parser(parser: ta.Optional['md.MarkdownIt'] = None) -> 'md.MarkdownIt':
|
|
24
|
+
if parser is None:
|
|
25
|
+
parser = md.MarkdownIt()
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
parser
|
|
29
|
+
.enable('strikethrough')
|
|
30
|
+
.enable('table')
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def markdown_from_tokens(tokens: ta.Sequence['md.token.Token']) -> 'rich.markdown.Markdown':
|
|
35
|
+
rmd = rich.markdown.Markdown('')
|
|
36
|
+
rmd.parsed = tokens # type: ignore[assignment]
|
|
37
|
+
return rmd
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def flatten_tokens_filter(token: 'md.token.Token') -> bool:
|
|
41
|
+
return (
|
|
42
|
+
token.type != 'fence' and
|
|
43
|
+
token.tag != 'img'
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def flatten_tokens(tokens: ta.Iterable['md.token.Token']) -> ta.Iterable['md.token.Token']:
|
|
48
|
+
return _flatten_tokens(tokens, filter=flatten_tokens_filter)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
##
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class MarkdownLiveStream(lang.ExitStacked, lang.Abstract):
|
|
55
|
+
def __init__(
|
|
56
|
+
self,
|
|
57
|
+
*,
|
|
58
|
+
parser: ta.Optional['md.MarkdownIt'] = None,
|
|
59
|
+
console: ta.Optional['rich.console.Console'] = None,
|
|
60
|
+
) -> None:
|
|
61
|
+
super().__init__()
|
|
62
|
+
|
|
63
|
+
if console is None:
|
|
64
|
+
console = rich.console.Console()
|
|
65
|
+
self._console = console
|
|
66
|
+
|
|
67
|
+
if parser is None:
|
|
68
|
+
parser = configure_markdown_parser()
|
|
69
|
+
self._parser = parser
|
|
70
|
+
|
|
71
|
+
self._lines_printed_to_scrollback = 0
|
|
72
|
+
|
|
73
|
+
_live: 'rich.live.Live' # noqa
|
|
74
|
+
|
|
75
|
+
def _enter_contexts(self) -> None:
|
|
76
|
+
super()._enter_contexts()
|
|
77
|
+
|
|
78
|
+
self._live = self._enter_context(rich.live.Live(
|
|
79
|
+
rich.text.Text(''),
|
|
80
|
+
console=self._console,
|
|
81
|
+
refresh_per_second=10,
|
|
82
|
+
))
|
|
83
|
+
|
|
84
|
+
def _console_render(self, obj: ta.Any) -> list[str]:
|
|
85
|
+
return console_render(
|
|
86
|
+
obj,
|
|
87
|
+
force_terminal=True,
|
|
88
|
+
width=self._console.width,
|
|
89
|
+
).splitlines()
|
|
90
|
+
|
|
91
|
+
def _console_render_markdown(self, src: str) -> list[str]:
|
|
92
|
+
return self._console_render(markdown_from_tokens(self._parser.parse(src)))
|
|
93
|
+
|
|
94
|
+
@abc.abstractmethod
|
|
95
|
+
def feed(self, s: str) -> None:
|
|
96
|
+
raise NotImplementedError
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class NaiveMarkdownLiveStream(MarkdownLiveStream):
|
|
100
|
+
_accumulated = ''
|
|
101
|
+
|
|
102
|
+
def feed(self, s: str) -> None:
|
|
103
|
+
self._accumulated += s
|
|
104
|
+
all_lines = self._console_render_markdown(self._accumulated)
|
|
105
|
+
|
|
106
|
+
# Calculate how many lines fit in the live window
|
|
107
|
+
available_height = self._console.height - 2
|
|
108
|
+
|
|
109
|
+
# Determine which lines overflow and need to be printed to scrollback
|
|
110
|
+
total_lines = len(all_lines)
|
|
111
|
+
if total_lines > available_height:
|
|
112
|
+
# Lines that should be in scrollback
|
|
113
|
+
lines_for_scrollback = total_lines - available_height
|
|
114
|
+
|
|
115
|
+
# Print any new lines that weren't already printed
|
|
116
|
+
if lines_for_scrollback > self._lines_printed_to_scrollback:
|
|
117
|
+
new_lines_to_print = all_lines[self._lines_printed_to_scrollback:lines_for_scrollback]
|
|
118
|
+
for line in new_lines_to_print:
|
|
119
|
+
self._live.console.print(rich.text.Text.from_ansi(line))
|
|
120
|
+
self._lines_printed_to_scrollback = lines_for_scrollback
|
|
121
|
+
|
|
122
|
+
# Show only the bottom portion in the live window
|
|
123
|
+
visible_lines = all_lines[-available_height:]
|
|
124
|
+
|
|
125
|
+
else:
|
|
126
|
+
visible_lines = all_lines
|
|
127
|
+
|
|
128
|
+
# Update the live display
|
|
129
|
+
self._live.update(rich.text.Text.from_ansi('\n'.join(visible_lines)))
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class IncrementalMarkdownLiveStream(MarkdownLiveStream):
|
|
133
|
+
def __init__(
|
|
134
|
+
self,
|
|
135
|
+
*,
|
|
136
|
+
parser: ta.Optional['md.MarkdownIt'] = None,
|
|
137
|
+
console: ta.Optional['rich.console.Console'] = None,
|
|
138
|
+
) -> None:
|
|
139
|
+
super().__init__(
|
|
140
|
+
parser=parser,
|
|
141
|
+
console=console,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
self._inc_parser = IncrementalMarkdownParser(parser=self._parser)
|
|
145
|
+
|
|
146
|
+
def feed(self, s: str) -> None:
|
|
147
|
+
ip_out = self._inc_parser.feed2(s)
|
|
148
|
+
|
|
149
|
+
if ip_out.new_stable:
|
|
150
|
+
# try:
|
|
151
|
+
# srs = getattr(self, '_srs')
|
|
152
|
+
# except AttributeError:
|
|
153
|
+
# setattr(self, '_srs', srs := [])
|
|
154
|
+
# from ...markdown.tokens import token_repr, flatten_tokens
|
|
155
|
+
# srs.extend(map(token_repr, flatten_tokens(ip_out.new_stable)))
|
|
156
|
+
|
|
157
|
+
stable_lines = self._console_render(markdown_from_tokens(ip_out.new_stable))
|
|
158
|
+
stable_lines.append(' ') # FIXME: lame hack
|
|
159
|
+
self._live.console.print(rich.text.Text.from_ansi('\n'.join(stable_lines), no_wrap=True))
|
|
160
|
+
self._lines_printed_to_scrollback = max(0, self._lines_printed_to_scrollback - len(stable_lines))
|
|
161
|
+
|
|
162
|
+
unstable_lines = self._console_render(markdown_from_tokens(ip_out.unstable))
|
|
163
|
+
|
|
164
|
+
# Calculate how many lines fit in the live window
|
|
165
|
+
available_height = self._console.height - 2
|
|
166
|
+
|
|
167
|
+
# Determine which lines overflow and need to be printed to scrollback
|
|
168
|
+
total_lines = len(unstable_lines)
|
|
169
|
+
if total_lines > available_height:
|
|
170
|
+
# Lines that should be in scrollback
|
|
171
|
+
lines_for_scrollback = total_lines - available_height
|
|
172
|
+
|
|
173
|
+
# Print any new lines that weren't already printed
|
|
174
|
+
if lines_for_scrollback > self._lines_printed_to_scrollback:
|
|
175
|
+
new_lines_to_print = unstable_lines[self._lines_printed_to_scrollback:lines_for_scrollback]
|
|
176
|
+
self._live.console.print(rich.text.Text.from_ansi('\n'.join(new_lines_to_print)))
|
|
177
|
+
self._lines_printed_to_scrollback = lines_for_scrollback
|
|
178
|
+
|
|
179
|
+
# Show only the bottom portion in the live window
|
|
180
|
+
visible_lines = unstable_lines[-available_height:]
|
|
181
|
+
|
|
182
|
+
else:
|
|
183
|
+
visible_lines = unstable_lines
|
|
184
|
+
|
|
185
|
+
# Update the live display
|
|
186
|
+
self._live.update(rich.text.Text.from_ansi('\n'.join(visible_lines)))
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# ruff: noqa: F401
|
|
2
|
+
# flake8: noqa: F401
|
|
3
|
+
from omlish import lang as _lang
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
with _lang.auto_proxy_init(globals()):
|
|
7
|
+
##
|
|
8
|
+
|
|
9
|
+
from textual import LogGroup # noqa
|
|
10
|
+
from textual import LogVerbosity # noqa
|
|
11
|
+
from textual import app # noqa
|
|
12
|
+
from textual import binding # noqa
|
|
13
|
+
from textual import constants # noqa
|
|
14
|
+
from textual import containers # noqa
|
|
15
|
+
from textual import content # noqa
|
|
16
|
+
from textual import driver # noqa
|
|
17
|
+
from textual import events # noqa
|
|
18
|
+
from textual import geometry # noqa
|
|
19
|
+
from textual import markup # noqa
|
|
20
|
+
from textual import message # noqa
|
|
21
|
+
from textual import messages # noqa
|
|
22
|
+
from textual import on # noqa
|
|
23
|
+
from textual import pad # noqa
|
|
24
|
+
from textual import reactive # noqa
|
|
25
|
+
from textual import screen # noqa
|
|
26
|
+
from textual import style # noqa
|
|
27
|
+
from textual import suggester # noqa
|
|
28
|
+
from textual import suggestions # noqa
|
|
29
|
+
from textual import timer # noqa
|
|
30
|
+
from textual import widget # noqa
|
|
31
|
+
from textual import widgets # noqa
|
|
32
|
+
from textual import work # noqa
|
|
33
|
+
from textual.app import ActionError # noqa
|
|
34
|
+
from textual.app import ActiveModeError # noqa
|
|
35
|
+
from textual.app import App as App_ # noqa
|
|
36
|
+
from textual.app import AppError # noqa
|
|
37
|
+
from textual.app import AutopilotCallbackType # noqa
|
|
38
|
+
from textual.app import CallThreadReturnType # noqa
|
|
39
|
+
from textual.app import CommandCallback # noqa
|
|
40
|
+
from textual.app import ComposeResult # noqa
|
|
41
|
+
from textual.app import InvalidModeError # noqa
|
|
42
|
+
from textual.app import InvalidThemeError # noqa
|
|
43
|
+
from textual.app import ModeError # noqa
|
|
44
|
+
from textual.app import RenderResult # noqa
|
|
45
|
+
from textual.app import ReturnType # noqa
|
|
46
|
+
from textual.app import ScreenError # noqa
|
|
47
|
+
from textual.app import ScreenStackError # noqa
|
|
48
|
+
from textual.app import ScreenType # noqa
|
|
49
|
+
from textual.app import SuspendNotSupported # noqa
|
|
50
|
+
from textual.app import SystemCommand # noqa
|
|
51
|
+
from textual.app import UnknownModeError # noqa
|
|
52
|
+
from textual.app import get_system_commands_provider # noqa
|
|
53
|
+
from textual.binding import ActiveBinding # noqa
|
|
54
|
+
from textual.binding import Binding # noqa
|
|
55
|
+
from textual.binding import BindingError # noqa
|
|
56
|
+
from textual.binding import BindingIDString # noqa
|
|
57
|
+
from textual.binding import BindingType # noqa
|
|
58
|
+
from textual.binding import BindingsMap # noqa
|
|
59
|
+
from textual.binding import InvalidBinding # noqa
|
|
60
|
+
from textual.binding import KeyString # noqa
|
|
61
|
+
from textual.binding import Keymap # noqa
|
|
62
|
+
from textual.binding import KeymapApplyResult # noqa
|
|
63
|
+
from textual.binding import NoBinding # noqa
|
|
64
|
+
from textual.containers import Center # noqa
|
|
65
|
+
from textual.containers import CenterMiddle # noqa
|
|
66
|
+
from textual.containers import Container # noqa
|
|
67
|
+
from textual.containers import Grid # noqa
|
|
68
|
+
from textual.containers import Horizontal # noqa
|
|
69
|
+
from textual.containers import HorizontalGroup # noqa
|
|
70
|
+
from textual.containers import HorizontalScroll # noqa
|
|
71
|
+
from textual.containers import ItemGrid # noqa
|
|
72
|
+
from textual.containers import Middle # noqa
|
|
73
|
+
from textual.containers import Right # noqa
|
|
74
|
+
from textual.containers import ScrollableContainer # noqa
|
|
75
|
+
from textual.containers import Vertical # noqa
|
|
76
|
+
from textual.containers import VerticalGroup # noqa
|
|
77
|
+
from textual.containers import VerticalScroll # noqa
|
|
78
|
+
from textual.content import Content # noqa
|
|
79
|
+
from textual.content import ContentText # noqa
|
|
80
|
+
from textual.content import ContentType # noqa
|
|
81
|
+
from textual.content import EMPTY_CONTENT # noqa
|
|
82
|
+
from textual.content import Span # noqa
|
|
83
|
+
from textual.dom import DOMError # noqa
|
|
84
|
+
from textual.dom import DOMNode # noqa
|
|
85
|
+
from textual.driver import Driver # noqa
|
|
86
|
+
from textual.events import Action # noqa
|
|
87
|
+
from textual.events import AppBlur # noqa
|
|
88
|
+
from textual.events import AppFocus # noqa
|
|
89
|
+
from textual.events import Blur # noqa
|
|
90
|
+
from textual.events import Callback # noqa
|
|
91
|
+
from textual.events import Click # noqa
|
|
92
|
+
from textual.events import Compose # noqa
|
|
93
|
+
from textual.events import CursorPosition # noqa
|
|
94
|
+
from textual.events import DeliveryComplete # noqa
|
|
95
|
+
from textual.events import DeliveryFailed # noqa
|
|
96
|
+
from textual.events import DescendantBlur # noqa
|
|
97
|
+
from textual.events import DescendantFocus # noqa
|
|
98
|
+
from textual.events import Enter # noqa
|
|
99
|
+
from textual.events import Event # noqa
|
|
100
|
+
from textual.events import Focus # noqa
|
|
101
|
+
from textual.events import Hide # noqa
|
|
102
|
+
from textual.events import Idle # noqa
|
|
103
|
+
from textual.events import InputEvent # noqa
|
|
104
|
+
from textual.events import Key # noqa
|
|
105
|
+
from textual.events import Leave # noqa
|
|
106
|
+
from textual.events import Load # noqa
|
|
107
|
+
from textual.events import Mount # noqa
|
|
108
|
+
from textual.events import MouseCapture # noqa
|
|
109
|
+
from textual.events import MouseDown # noqa
|
|
110
|
+
from textual.events import MouseEvent # noqa
|
|
111
|
+
from textual.events import MouseMove # noqa
|
|
112
|
+
from textual.events import MouseRelease # noqa
|
|
113
|
+
from textual.events import MouseScrollDown # noqa
|
|
114
|
+
from textual.events import MouseScrollLeft # noqa
|
|
115
|
+
from textual.events import MouseScrollRight # noqa
|
|
116
|
+
from textual.events import MouseScrollUp # noqa
|
|
117
|
+
from textual.events import MouseUp # noqa
|
|
118
|
+
from textual.events import Paste # noqa
|
|
119
|
+
from textual.events import Print # noqa
|
|
120
|
+
from textual.events import Ready # noqa
|
|
121
|
+
from textual.events import Resize # noqa
|
|
122
|
+
from textual.events import ScreenResume # noqa
|
|
123
|
+
from textual.events import ScreenSuspend # noqa
|
|
124
|
+
from textual.events import Show # noqa
|
|
125
|
+
from textual.events import Timer as TimerEvent # noqa
|
|
126
|
+
from textual.events import Unmount # noqa
|
|
127
|
+
from textual.geometry import NULL_OFFSET # noqa
|
|
128
|
+
from textual.geometry import NULL_REGION # noqa
|
|
129
|
+
from textual.geometry import NULL_SIZE # noqa
|
|
130
|
+
from textual.geometry import NULL_SPACING # noqa
|
|
131
|
+
from textual.geometry import Offset # noqa
|
|
132
|
+
from textual.geometry import Region # noqa
|
|
133
|
+
from textual.geometry import Size # noqa
|
|
134
|
+
from textual.geometry import Spacing # noqa
|
|
135
|
+
from textual.geometry import SpacingDimensions # noqa
|
|
136
|
+
from textual.geometry import clamp # noqa
|
|
137
|
+
from textual.markup import MarkupError # noqa
|
|
138
|
+
from textual.markup import MarkupTokenizer # noqa
|
|
139
|
+
from textual.markup import StyleTokenizer # noqa
|
|
140
|
+
from textual.markup import escape # noqa
|
|
141
|
+
from textual.markup import parse_style # noqa
|
|
142
|
+
from textual.markup import to_content # noqa
|
|
143
|
+
from textual.message import Message # noqa
|
|
144
|
+
from textual.messages import CloseMessages # noqa
|
|
145
|
+
from textual.messages import ExitApp # noqa
|
|
146
|
+
from textual.messages import InBandWindowResize # noqa
|
|
147
|
+
from textual.messages import InvokeLater # noqa
|
|
148
|
+
from textual.messages import Layout # noqa
|
|
149
|
+
from textual.messages import Prompt # noqa
|
|
150
|
+
from textual.messages import Prune # noqa
|
|
151
|
+
from textual.messages import ScrollToRegion # noqa
|
|
152
|
+
from textual.messages import TerminalSupportsSynchronizedOutput # noqa
|
|
153
|
+
from textual.messages import Update # noqa
|
|
154
|
+
from textual.messages import UpdateScroll # noqa
|
|
155
|
+
from textual.pad import HorizontalPad # noqa
|
|
156
|
+
from textual.reactive import Initialize # noqa
|
|
157
|
+
from textual.reactive import Reactive # noqa
|
|
158
|
+
from textual.reactive import ReactiveError # noqa
|
|
159
|
+
from textual.reactive import await_watcher # noqa
|
|
160
|
+
from textual.reactive import invoke_watcher # noqa
|
|
161
|
+
from textual.reactive import reactive as reactive_ # noqa
|
|
162
|
+
from textual.reactive import var # noqa
|
|
163
|
+
from textual.screen import ModalScreen # noqa
|
|
164
|
+
from textual.screen import Screen # noqa
|
|
165
|
+
from textual.screen import SystemModalScreen # noqa
|
|
166
|
+
from textual.style import Style # noqa
|
|
167
|
+
from textual.suggester import SuggestFromList # noqa
|
|
168
|
+
from textual.suggester import Suggester # noqa
|
|
169
|
+
from textual.suggester import SuggestionReady # noqa
|
|
170
|
+
from textual.suggestions import get_suggestion # noqa
|
|
171
|
+
from textual.suggestions import get_suggestions # noqa
|
|
172
|
+
from textual.timer import Timer # noqa
|
|
173
|
+
from textual.timer import TimerCallback # noqa
|
|
174
|
+
from textual.widget import Widget # noqa
|
|
175
|
+
from textual.widgets import Button # noqa
|
|
176
|
+
from textual.widgets import Checkbox # noqa
|
|
177
|
+
from textual.widgets import Collapsible # noqa
|
|
178
|
+
from textual.widgets import ContentSwitcher # noqa
|
|
179
|
+
from textual.widgets import DataTable # noqa
|
|
180
|
+
from textual.widgets import Digits # noqa
|
|
181
|
+
from textual.widgets import DirectoryTree # noqa
|
|
182
|
+
from textual.widgets import Footer # noqa
|
|
183
|
+
from textual.widgets import Header # noqa
|
|
184
|
+
from textual.widgets import HelpPanel # noqa
|
|
185
|
+
from textual.widgets import Input # noqa
|
|
186
|
+
from textual.widgets import KeyPanel # noqa
|
|
187
|
+
from textual.widgets import Label # noqa
|
|
188
|
+
from textual.widgets import Link # noqa
|
|
189
|
+
from textual.widgets import ListItem # noqa
|
|
190
|
+
from textual.widgets import ListView # noqa
|
|
191
|
+
from textual.widgets import LoadingIndicator # noqa
|
|
192
|
+
from textual.widgets import Log # noqa
|
|
193
|
+
from textual.widgets import Markdown # noqa
|
|
194
|
+
from textual.widgets import MarkdownViewer # noqa
|
|
195
|
+
from textual.widgets import MaskedInput # noqa
|
|
196
|
+
from textual.widgets import OptionList # noqa
|
|
197
|
+
from textual.widgets import Placeholder # noqa
|
|
198
|
+
from textual.widgets import Pretty # noqa
|
|
199
|
+
from textual.widgets import ProgressBar # noqa
|
|
200
|
+
from textual.widgets import RadioButton # noqa
|
|
201
|
+
from textual.widgets import RadioSet # noqa
|
|
202
|
+
from textual.widgets import RichLog # noqa
|
|
203
|
+
from textual.widgets import Rule # noqa
|
|
204
|
+
from textual.widgets import Select # noqa
|
|
205
|
+
from textual.widgets import SelectionList # noqa
|
|
206
|
+
from textual.widgets import Sparkline # noqa
|
|
207
|
+
from textual.widgets import Static # noqa
|
|
208
|
+
from textual.widgets import Switch # noqa
|
|
209
|
+
from textual.widgets import Tab # noqa
|
|
210
|
+
from textual.widgets import TabPane # noqa
|
|
211
|
+
from textual.widgets import TabbedContent # noqa
|
|
212
|
+
from textual.widgets import Tabs # noqa
|
|
213
|
+
from textual.widgets import TextArea # noqa
|
|
214
|
+
from textual.widgets import Tooltip # noqa
|
|
215
|
+
from textual.widgets import Tree # noqa
|
|
216
|
+
from textual.widgets import Welcome # noqa
|
|
217
|
+
from textual.widgets.markdown import MarkdownBlock # noqa
|
|
218
|
+
from textual.widgets.markdown import MarkdownFence # noqa
|
|
219
|
+
from textual.widgets.markdown import MarkdownStream # noqa
|
|
220
|
+
from textual.widgets.markdown import MarkdownTableOfContents # noqa
|
|
221
|
+
from textual.widgets.option_list import DuplicateID # noqa
|
|
222
|
+
from textual.widgets.option_list import Option # noqa
|
|
223
|
+
from textual.widgets.option_list import OptionDoesNotExist # noqa
|
|
224
|
+
|
|
225
|
+
##
|
|
226
|
+
|
|
227
|
+
from textual_dev.client import DevtoolsClient # noqa
|
|
228
|
+
from textual_dev.client import DevtoolsConnectionError # noqa
|
|
229
|
+
from textual_dev.client import DevtoolsConsole # noqa
|
|
230
|
+
from textual_dev.client import DevtoolsLog # noqa
|
|
231
|
+
|
|
232
|
+
##
|
|
233
|
+
|
|
234
|
+
from . devtools import ( # noqa
|
|
235
|
+
DevtoolsConfig,
|
|
236
|
+
connect_devtools,
|
|
237
|
+
|
|
238
|
+
DevtoolsAppMixin,
|
|
239
|
+
|
|
240
|
+
DevtoolsSetup,
|
|
241
|
+
DevtoolsManager,
|
|
242
|
+
|
|
243
|
+
DevtoolsLoggingHandler,
|
|
244
|
+
set_root_logger_to_devtools,
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
from . import debug # noqa
|
|
248
|
+
|
|
249
|
+
from .app2 import ( # noqa
|
|
250
|
+
App,
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
from .drivers2 import ( # noqa
|
|
254
|
+
PendingWritesDriverMixin,
|
|
255
|
+
get_pending_writes_driver_class,
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
from .logging2 import ( # noqa
|
|
259
|
+
translate_log_level,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
from .types import ( # noqa
|
|
263
|
+
TopRightBottomLeft,
|
|
264
|
+
trbl_to_dict,
|
|
265
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import typing as ta
|
|
2
|
+
|
|
3
|
+
from textual.app import App as App_
|
|
4
|
+
from textual.binding import BindingType # noqa
|
|
5
|
+
|
|
6
|
+
from .devtools import DevtoolsAppMixin
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
##
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class App(
|
|
13
|
+
DevtoolsAppMixin,
|
|
14
|
+
App_,
|
|
15
|
+
):
|
|
16
|
+
BINDINGS: ta.ClassVar[ta.Sequence[BindingType]] = App_.BINDINGS # type: ignore[assignment]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Darren Burns
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 Darren Burns
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
6
|
+
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
7
|
+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
8
|
+
# persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
9
|
+
#
|
|
10
|
+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
11
|
+
# Software.
|
|
12
|
+
#
|
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
14
|
+
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
15
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
16
|
+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
17
|
+
#
|
|
18
|
+
# https://github.com/darrenburns/textual-autocomplete/tree/0344cd3eb3383cbbd80e01b035ed808ce53cef4d
|
|
19
|
+
from .matching import ( # noqa
|
|
20
|
+
FuzzySearch,
|
|
21
|
+
FuzzyMatcher,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
from .paths import ( # noqa
|
|
25
|
+
PathAutoComplete,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
from .widget import ( # noqa
|
|
29
|
+
AutoCompleteItem,
|
|
30
|
+
AutoCompleteItemHit,
|
|
31
|
+
AutoCompleteList,
|
|
32
|
+
AutoComplete,
|
|
33
|
+
)
|