euporie 2.8.1__py3-none-any.whl → 2.8.5__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.
- euporie/console/_commands.py +143 -0
- euporie/console/_settings.py +58 -0
- euporie/console/app.py +25 -71
- euporie/console/tabs/console.py +267 -147
- euporie/core/__init__.py +1 -9
- euporie/core/__main__.py +31 -5
- euporie/core/_settings.py +104 -0
- euporie/core/app/__init__.py +3 -0
- euporie/core/app/_commands.py +70 -0
- euporie/core/app/_settings.py +427 -0
- euporie/core/{app.py → app/app.py} +214 -572
- euporie/core/app/base.py +51 -0
- euporie/core/{current.py → app/current.py} +13 -4
- euporie/core/app/cursor.py +35 -0
- euporie/core/app/dummy.py +12 -0
- euporie/core/app/launch.py +28 -0
- euporie/core/bars/__init__.py +11 -0
- euporie/core/bars/command.py +182 -0
- euporie/core/bars/menu.py +258 -0
- euporie/core/{widgets → bars}/search.py +154 -57
- euporie/core/{widgets → bars}/status.py +9 -26
- euporie/core/clipboard.py +19 -80
- euporie/core/comm/base.py +8 -6
- euporie/core/comm/ipywidgets.py +21 -12
- euporie/core/comm/registry.py +2 -1
- euporie/core/commands.py +11 -5
- euporie/core/completion.py +3 -2
- euporie/core/config.py +368 -341
- euporie/core/convert/__init__.py +0 -30
- euporie/core/convert/datum.py +131 -60
- euporie/core/convert/formats/__init__.py +31 -0
- euporie/core/convert/formats/ansi.py +46 -30
- euporie/core/convert/formats/common.py +11 -23
- euporie/core/convert/formats/html.py +45 -40
- euporie/core/convert/formats/pil.py +1 -1
- euporie/core/convert/formats/png.py +3 -5
- euporie/core/convert/formats/sixel.py +3 -3
- euporie/core/convert/registry.py +11 -8
- euporie/core/convert/utils.py +50 -23
- euporie/core/diagnostics.py +2 -2
- euporie/core/filters.py +72 -82
- euporie/core/format.py +13 -2
- euporie/core/ft/ansi.py +1 -1
- euporie/core/ft/html.py +36 -36
- euporie/core/ft/table.py +1 -3
- euporie/core/ft/utils.py +4 -1
- euporie/core/graphics.py +216 -124
- euporie/core/history.py +2 -2
- euporie/core/inspection.py +3 -2
- euporie/core/io.py +207 -28
- euporie/core/kernel/__init__.py +1 -0
- euporie/core/{kernel.py → kernel/client.py} +100 -139
- euporie/core/kernel/manager.py +114 -0
- euporie/core/key_binding/bindings/__init__.py +2 -8
- euporie/core/key_binding/bindings/basic.py +47 -7
- euporie/core/key_binding/bindings/completion.py +3 -8
- euporie/core/key_binding/bindings/micro.py +5 -7
- euporie/core/key_binding/bindings/mouse.py +26 -24
- euporie/core/key_binding/bindings/terminal.py +193 -0
- euporie/core/key_binding/bindings/vi.py +46 -0
- euporie/core/key_binding/key_processor.py +43 -2
- euporie/core/key_binding/registry.py +2 -0
- euporie/core/key_binding/utils.py +22 -2
- euporie/core/keys.py +7156 -93
- euporie/core/layout/cache.py +35 -25
- euporie/core/layout/containers.py +280 -74
- euporie/core/layout/decor.py +5 -5
- euporie/core/layout/mouse.py +1 -1
- euporie/core/layout/print.py +16 -3
- euporie/core/layout/scroll.py +26 -28
- euporie/core/log.py +75 -60
- euporie/core/lsp.py +118 -24
- euporie/core/margins.py +60 -31
- euporie/core/path.py +2 -1
- euporie/core/renderer.py +58 -17
- euporie/core/style.py +60 -40
- euporie/core/suggest.py +103 -85
- euporie/core/tabs/__init__.py +34 -0
- euporie/core/tabs/_settings.py +113 -0
- euporie/core/tabs/base.py +11 -435
- euporie/core/tabs/kernel.py +420 -0
- euporie/core/tabs/notebook.py +20 -54
- euporie/core/utils.py +98 -6
- euporie/core/validation.py +1 -1
- euporie/core/widgets/_settings.py +188 -0
- euporie/core/widgets/cell.py +90 -158
- euporie/core/widgets/cell_outputs.py +25 -36
- euporie/core/widgets/decor.py +11 -41
- euporie/core/widgets/dialog.py +55 -44
- euporie/core/widgets/display.py +27 -24
- euporie/core/widgets/file_browser.py +5 -26
- euporie/core/widgets/forms.py +16 -12
- euporie/core/widgets/inputs.py +37 -81
- euporie/core/widgets/layout.py +7 -6
- euporie/core/widgets/logo.py +49 -0
- euporie/core/widgets/menu.py +13 -11
- euporie/core/widgets/pager.py +8 -11
- euporie/core/widgets/palette.py +6 -6
- euporie/hub/app.py +52 -31
- euporie/notebook/_commands.py +24 -0
- euporie/notebook/_settings.py +107 -0
- euporie/notebook/app.py +109 -210
- euporie/notebook/filters.py +1 -1
- euporie/notebook/tabs/__init__.py +46 -7
- euporie/notebook/tabs/_commands.py +714 -0
- euporie/notebook/tabs/_settings.py +32 -0
- euporie/notebook/tabs/display.py +2 -2
- euporie/notebook/tabs/edit.py +12 -7
- euporie/notebook/tabs/json.py +3 -3
- euporie/notebook/tabs/log.py +1 -18
- euporie/notebook/tabs/notebook.py +21 -674
- euporie/notebook/widgets/_commands.py +11 -0
- euporie/notebook/widgets/_settings.py +19 -0
- euporie/notebook/widgets/side_bar.py +14 -34
- euporie/preview/_settings.py +104 -0
- euporie/preview/app.py +8 -30
- euporie/preview/tabs/notebook.py +15 -86
- euporie/web/tabs/web.py +4 -6
- euporie/web/widgets/webview.py +5 -12
- {euporie-2.8.1.dist-info → euporie-2.8.5.dist-info}/METADATA +11 -15
- euporie-2.8.5.dist-info/RECORD +172 -0
- {euporie-2.8.1.dist-info → euporie-2.8.5.dist-info}/WHEEL +1 -1
- {euporie-2.8.1.dist-info → euporie-2.8.5.dist-info}/entry_points.txt +2 -2
- {euporie-2.8.1.dist-info → euporie-2.8.5.dist-info}/licenses/LICENSE +1 -1
- euporie/core/launch.py +0 -59
- euporie/core/terminal.py +0 -527
- euporie-2.8.1.dist-info/RECORD +0 -146
- {euporie-2.8.1.data → euporie-2.8.5.data}/data/share/applications/euporie-console.desktop +0 -0
- {euporie-2.8.1.data → euporie-2.8.5.data}/data/share/applications/euporie-notebook.desktop +0 -0
euporie/core/commands.py
CHANGED
@@ -15,7 +15,8 @@ from prompt_toolkit.key_binding.key_processor import KeyPressEvent
|
|
15
15
|
from euporie.core.key_binding.utils import parse_keys
|
16
16
|
|
17
17
|
if TYPE_CHECKING:
|
18
|
-
from
|
18
|
+
from collections.abc import Coroutine
|
19
|
+
from typing import Any, Callable
|
19
20
|
|
20
21
|
from prompt_toolkit.filters import Filter, FilterOrBool
|
21
22
|
from prompt_toolkit.key_binding.key_bindings import (
|
@@ -50,6 +51,7 @@ class Command:
|
|
50
51
|
filter: FilterOrBool = True,
|
51
52
|
hidden: FilterOrBool = False,
|
52
53
|
name: str | None = None,
|
54
|
+
aliases: list[str] | None = None,
|
53
55
|
title: str | None = None,
|
54
56
|
menu_title: str | None = None,
|
55
57
|
description: str | None = None,
|
@@ -66,6 +68,7 @@ class Command:
|
|
66
68
|
filter: The condition under which the command is allowed to run
|
67
69
|
hidden: The condition under the command is visible to the user
|
68
70
|
name: The name of the command, for accessing the command from the registry
|
71
|
+
aliases: List of additional names for the command
|
69
72
|
title: The title of the command for display
|
70
73
|
menu_title: The title to display in menus if different
|
71
74
|
description: The description of the command to explain it's function
|
@@ -77,6 +80,7 @@ class Command:
|
|
77
80
|
|
78
81
|
"""
|
79
82
|
self.handler = handler
|
83
|
+
self.aliases = aliases or []
|
80
84
|
self.filter = to_filter(filter)
|
81
85
|
self.hidden = to_filter(hidden)
|
82
86
|
if name is None:
|
@@ -106,18 +110,18 @@ class Command:
|
|
106
110
|
|
107
111
|
self.keys: list[tuple[str | Keys, ...]] = []
|
108
112
|
|
109
|
-
def run(self) -> None:
|
113
|
+
def run(self, arg: str | None = None) -> None:
|
110
114
|
"""Run the command's handler."""
|
111
115
|
if self.filter():
|
112
116
|
app = get_app()
|
113
117
|
result = self.key_handler(
|
114
118
|
KeyPressEvent(
|
115
119
|
key_processor_ref=weakref.ref(app.key_processor),
|
116
|
-
arg=
|
120
|
+
arg=arg,
|
117
121
|
key_sequence=[],
|
118
122
|
previous_key_sequence=[],
|
119
123
|
is_repeat=False,
|
120
|
-
)
|
124
|
+
),
|
121
125
|
)
|
122
126
|
if isawaitable(result):
|
123
127
|
|
@@ -222,6 +226,8 @@ def add_cmd(**kwargs: Any) -> Callable:
|
|
222
226
|
def decorator(handler: Callable) -> Callable:
|
223
227
|
cmd = Command(handler, **kwargs)
|
224
228
|
commands[cmd.name] = cmd
|
229
|
+
for alias in cmd.aliases:
|
230
|
+
commands[alias] = cmd
|
225
231
|
return handler
|
226
232
|
|
227
233
|
return decorator
|
@@ -243,4 +249,4 @@ def get_cmd(name: str) -> Command:
|
|
243
249
|
try:
|
244
250
|
return commands[name]
|
245
251
|
except KeyError as e:
|
246
|
-
raise KeyError("Unknown command:
|
252
|
+
raise KeyError(f"Unknown command: {name}") from e
|
euporie/core/completion.py
CHANGED
@@ -3,16 +3,17 @@
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
5
|
import logging
|
6
|
-
from typing import TYPE_CHECKING
|
6
|
+
from typing import TYPE_CHECKING
|
7
7
|
|
8
8
|
from prompt_toolkit.completion.base import CompleteEvent, Completer, Completion
|
9
9
|
|
10
10
|
if TYPE_CHECKING:
|
11
|
+
from collections.abc import AsyncGenerator, Iterable
|
11
12
|
from pathlib import Path
|
12
13
|
|
13
14
|
from prompt_toolkit.document import Document
|
14
15
|
|
15
|
-
from euporie.core.kernel import Kernel
|
16
|
+
from euporie.core.kernel.client import Kernel
|
16
17
|
from euporie.core.lsp import LspClient
|
17
18
|
|
18
19
|
log = logging.getLogger(__name__)
|