euporie 2.8.2__py3-none-any.whl → 2.8.3__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/core/__init__.py +1 -1
- euporie/core/app.py +11 -0
- euporie/core/widgets/inputs.py +21 -9
- euporie/notebook/app.py +9 -1
- {euporie-2.8.2.dist-info → euporie-2.8.3.dist-info}/METADATA +2 -2
- {euporie-2.8.2.dist-info → euporie-2.8.3.dist-info}/RECORD +11 -11
- {euporie-2.8.2.data → euporie-2.8.3.data}/data/share/applications/euporie-console.desktop +0 -0
- {euporie-2.8.2.data → euporie-2.8.3.data}/data/share/applications/euporie-notebook.desktop +0 -0
- {euporie-2.8.2.dist-info → euporie-2.8.3.dist-info}/WHEEL +0 -0
- {euporie-2.8.2.dist-info → euporie-2.8.3.dist-info}/entry_points.txt +0 -0
- {euporie-2.8.2.dist-info → euporie-2.8.3.dist-info}/licenses/LICENSE +0 -0
euporie/core/__init__.py
CHANGED
euporie/core/app.py
CHANGED
@@ -1056,6 +1056,17 @@ class BaseApp(Application):
|
|
1056
1056
|
""",
|
1057
1057
|
)
|
1058
1058
|
|
1059
|
+
add_setting(
|
1060
|
+
name="syntax_highlighting",
|
1061
|
+
flags=["--syntax-highlighting"],
|
1062
|
+
type_=bool,
|
1063
|
+
help_="Syntax highlighting",
|
1064
|
+
default=True,
|
1065
|
+
description="""
|
1066
|
+
Enable or disable syntax highlighting in code input fields.
|
1067
|
+
""",
|
1068
|
+
)
|
1069
|
+
|
1059
1070
|
add_setting(
|
1060
1071
|
name="syntax_theme",
|
1061
1072
|
flags=["--syntax-theme"],
|
euporie/core/widgets/inputs.py
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
5
|
import logging
|
6
|
+
from functools import lru_cache
|
6
7
|
from typing import TYPE_CHECKING
|
7
8
|
|
8
9
|
from prompt_toolkit.auto_suggest import AutoSuggest, DynamicAutoSuggest
|
@@ -97,6 +98,21 @@ if TYPE_CHECKING:
|
|
97
98
|
log = logging.getLogger(__name__)
|
98
99
|
|
99
100
|
|
101
|
+
@lru_cache
|
102
|
+
def _get_lexer(highlight: bool, lexer: Lexer | None, language: str) -> Lexer:
|
103
|
+
"""Determine which lexer should be used for syntax highlighting."""
|
104
|
+
if not highlight:
|
105
|
+
return SimpleLexer()
|
106
|
+
elif lexer is not None:
|
107
|
+
return lexer
|
108
|
+
try:
|
109
|
+
pygments_lexer_class = get_lexer_by_name(language).__class__
|
110
|
+
except ClassNotFound:
|
111
|
+
return SimpleLexer()
|
112
|
+
else:
|
113
|
+
return PygmentsLexer(pygments_lexer_class, sync_from_start=False)
|
114
|
+
|
115
|
+
|
100
116
|
class KernelInput(TextArea):
|
101
117
|
"""Kernel input text areas.
|
102
118
|
|
@@ -182,14 +198,6 @@ class KernelInput(TextArea):
|
|
182
198
|
self._language = language
|
183
199
|
self.lexer = lexer
|
184
200
|
|
185
|
-
def _get_lexer() -> Lexer:
|
186
|
-
try:
|
187
|
-
pygments_lexer_class = get_lexer_by_name(self.language).__class__
|
188
|
-
except ClassNotFound:
|
189
|
-
return SimpleLexer()
|
190
|
-
else:
|
191
|
-
return PygmentsLexer(pygments_lexer_class, sync_from_start=False)
|
192
|
-
|
193
201
|
self.formatters = formatters if formatters is not None else []
|
194
202
|
self._diagnostics = diagnostics or Report()
|
195
203
|
self.inspector = inspector
|
@@ -241,7 +249,11 @@ class KernelInput(TextArea):
|
|
241
249
|
|
242
250
|
self.control = BufferControl(
|
243
251
|
buffer=self.buffer,
|
244
|
-
lexer=DynamicLexer(
|
252
|
+
lexer=DynamicLexer(
|
253
|
+
lambda: _get_lexer(
|
254
|
+
app.config.syntax_highlighting, self.lexer, self.language
|
255
|
+
)
|
256
|
+
),
|
245
257
|
input_processors=[
|
246
258
|
ConditionalProcessor(
|
247
259
|
DiagnosticProcessor(_get_diagnostics),
|
euporie/notebook/app.py
CHANGED
@@ -445,7 +445,15 @@ class NotebookApp(BaseApp):
|
|
445
445
|
description="Turn elements of euporie's interface on or off",
|
446
446
|
),
|
447
447
|
self.config.get_item("color_scheme").menu,
|
448
|
-
|
448
|
+
MenuItem(
|
449
|
+
"Syntax highlighting",
|
450
|
+
children=[
|
451
|
+
self.config.get_item("syntax_highlighting").menu,
|
452
|
+
separator,
|
453
|
+
*self.config.get_item("syntax_theme").menu.children,
|
454
|
+
],
|
455
|
+
description="Configure syntax highlighting",
|
456
|
+
),
|
449
457
|
get_cmd("toggle-expand").menu,
|
450
458
|
get_cmd("toggle-line-numbers").menu,
|
451
459
|
self.config.get_item("set_cursor_shape").menu,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: euporie
|
3
|
-
Version: 2.8.
|
3
|
+
Version: 2.8.3
|
4
4
|
Summary: Euporie is a suite of terminal applications for interacting with Jupyter kernels
|
5
5
|
Project-URL: Documentation, https://euporie.readthedocs.io/en/latest
|
6
6
|
Project-URL: Issues, https://github.com/joouha/euporie/issues
|
@@ -29,7 +29,7 @@ Requires-Dist: imagesize~=1.3
|
|
29
29
|
Requires-Dist: jupyter-client>=7.1
|
30
30
|
Requires-Dist: jupytext>=1.14.0
|
31
31
|
Requires-Dist: linkify-it-py~=1.0
|
32
|
-
Requires-Dist: markdown-it-py~=2.
|
32
|
+
Requires-Dist: markdown-it-py~=2.2.0
|
33
33
|
Requires-Dist: mdit-py-plugins~=0.3.0
|
34
34
|
Requires-Dist: nbformat~=5.0
|
35
35
|
Requires-Dist: pillow>=9.0
|
@@ -4,9 +4,9 @@ euporie/console/app.py,sha256=Icu-q-qTOuap873-s0ONcrtluD6EH5DPlbxX8ue6Zqo,7379
|
|
4
4
|
euporie/console/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
euporie/console/tabs/__init__.py,sha256=Grm9EO1gnBO1o-k6Nqnlzo8XLIgFZSXNAdz49Vvh4zY,55
|
6
6
|
euporie/console/tabs/console.py,sha256=egClI0kRqQeBKjXOthxgpQ4eQpekaaN1LM76tKXJlEA,26109
|
7
|
-
euporie/core/__init__.py,sha256=
|
7
|
+
euporie/core/__init__.py,sha256=Qk14pXMsR00wCnGYpMoqM4Acmqlaf1p7KKV8jKKIcdQ,313
|
8
8
|
euporie/core/__main__.py,sha256=_TeewhwpThCpmL8qYYtd61qeE_t61To1zrcM9o4lL_s,842
|
9
|
-
euporie/core/app.py,sha256=
|
9
|
+
euporie/core/app.py,sha256=ZXpGbIOjMYahcUMIZw8DSumuWb45iE84-xgY7JQtJG8,46329
|
10
10
|
euporie/core/border.py,sha256=kJbpyxwJBtIRpFOpXhDtaCT1_oyVRjRiYKG4lXn3-iA,48507
|
11
11
|
euporie/core/clipboard.py,sha256=Ps1wTcIV2B1PKfXiNKITR8nee2bo5qVfdCuhobiCNms,4461
|
12
12
|
euporie/core/commands.py,sha256=uOS4cJTzxSv8jEMComMDAqaAUrsPjaB_AY4tTeZFGfY,8256
|
@@ -100,7 +100,7 @@ euporie/core/widgets/display.py,sha256=UicJq9iSzHrrYXdXTXWPvBsC69ttZU8GHJ7xRK5Fb
|
|
100
100
|
euporie/core/widgets/file_browser.py,sha256=SmoQnngytD8-NgiRCKNLeFSdrqSCWRUUaGu8Tq295TQ,20731
|
101
101
|
euporie/core/widgets/formatted_text_area.py,sha256=J7P_TNXPZKZkiBdjAVkPvkfRY1veXe4tzXU241k4b-Q,4037
|
102
102
|
euporie/core/widgets/forms.py,sha256=iZj09v9I91ByuwUpGvf1FZrH2LF8FDIE-2MuAGIbLeA,85459
|
103
|
-
euporie/core/widgets/inputs.py,sha256=
|
103
|
+
euporie/core/widgets/inputs.py,sha256=Rpsy-kouiDeoSWPs89l1pSTXGnyAV0_tufQ3EqZp1P8,21826
|
104
104
|
euporie/core/widgets/layout.py,sha256=GAmWCUIhyhFvk0RBx8L7VeQpudKaFgkoyTk1tRKDJ94,23490
|
105
105
|
euporie/core/widgets/menu.py,sha256=K5Zkv_wKs7-2ZgMDygLDTKj5Vkh7MPLwc9ZWIhXa_xM,32856
|
106
106
|
euporie/core/widgets/pager.py,sha256=mbqB2-mX8bORUKM5492s5K9rpoGrvrBN1qY7uYE9o0g,6527
|
@@ -116,7 +116,7 @@ euporie/hub/app.py,sha256=w1J4A0X-W8Tr_rlRm13jMDjn35ggTOggDDVhCSIvitE,6129
|
|
116
116
|
euporie/hub/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
117
117
|
euporie/notebook/__init__.py,sha256=rOE71d95pym_ILYVg07NO9oDYbSB0AskxbC8cr4htiU,44
|
118
118
|
euporie/notebook/__main__.py,sha256=m2EnzIDLO4dHlDt41JNKpUvAUSw6wD-X0V3YhymXqxc,289
|
119
|
-
euporie/notebook/app.py,sha256=
|
119
|
+
euporie/notebook/app.py,sha256=JySFMBP0QkvJHlyFCbLfzZBijJjixmVSek-lruTAD1Q,21686
|
120
120
|
euporie/notebook/current.py,sha256=rQ_R9B0b8JmWILxEyGzGfuVY2iVkHTghq4qRiC-MYSU,387
|
121
121
|
euporie/notebook/enums.py,sha256=g7quMch8KAlaaYJS0UppWqx6tx-ZFt7HxFcmEfam5OM,221
|
122
122
|
euporie/notebook/filters.py,sha256=c2PncF-n4dE67cFmVmhsMhFVWCfxePAaCW6mb6zm0Yo,1502
|
@@ -137,10 +137,10 @@ euporie/preview/tabs/__init__.py,sha256=rY6DfQ-8qRo_AiICCD-zTyhJBnuMjawWDd8tRxR6
|
|
137
137
|
euporie/preview/tabs/notebook.py,sha256=IHY-cAWo5UmehmXpSSLyuTJvjN9jBeD5BsSoa86zrUw,8504
|
138
138
|
euporie/web/tabs/web.py,sha256=6wTB7ZLRqG79eQwKwsPIw03gHDUalmMVROSS9Z9j3YM,5228
|
139
139
|
euporie/web/widgets/webview.py,sha256=PA8hWqJs8FLMEFNAHYKz4Zt2fJTg-BSyuCji6isxz3o,20800
|
140
|
-
euporie-2.8.
|
141
|
-
euporie-2.8.
|
142
|
-
euporie-2.8.
|
143
|
-
euporie-2.8.
|
144
|
-
euporie-2.8.
|
145
|
-
euporie-2.8.
|
146
|
-
euporie-2.8.
|
140
|
+
euporie-2.8.3.data/data/share/applications/euporie-console.desktop,sha256=DI08G0Dl2s5asM6afWUfkKvO5YmcBm-pWQZzUHiNnqc,153
|
141
|
+
euporie-2.8.3.data/data/share/applications/euporie-notebook.desktop,sha256=RtpJzvizTDuOp0BLa2bLgVHx11LG6L7PL-oF-wHTsgU,155
|
142
|
+
euporie-2.8.3.dist-info/METADATA,sha256=a5j1deTZou2cOApnrYnNxEO-rYXgRBNHThbUNQijlD0,6417
|
143
|
+
euporie-2.8.3.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
144
|
+
euporie-2.8.3.dist-info/entry_points.txt,sha256=iHdjwf9iCAipy7w3tXCH2W_SavHVCSHpJk_84--b7rE,776
|
145
|
+
euporie-2.8.3.dist-info/licenses/LICENSE,sha256=rI0bfSsCfCVw6d8vk7WokRxd3t8yx5xV4fC5fwaMgCg,1079
|
146
|
+
euporie-2.8.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|