euporie 2.8.9__tar.gz → 2.8.11__tar.gz

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.
Files changed (177) hide show
  1. {euporie-2.8.9 → euporie-2.8.11}/PKG-INFO +1 -1
  2. {euporie-2.8.9 → euporie-2.8.11}/euporie/console/tabs/console.py +4 -1
  3. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/__init__.py +1 -1
  4. euporie-2.8.11/euporie/core/kernel/_settings.py +24 -0
  5. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/kernel/local.py +75 -1
  6. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/_settings.py +7 -2
  7. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/inputs.py +1 -1
  8. {euporie-2.8.9 → euporie-2.8.11}/.gitignore +0 -0
  9. {euporie-2.8.9 → euporie-2.8.11}/LICENSE +0 -0
  10. {euporie-2.8.9 → euporie-2.8.11}/README.rst +0 -0
  11. {euporie-2.8.9 → euporie-2.8.11}/euporie/console/__init__.py +0 -0
  12. {euporie-2.8.9 → euporie-2.8.11}/euporie/console/__main__.py +0 -0
  13. {euporie-2.8.9 → euporie-2.8.11}/euporie/console/_commands.py +0 -0
  14. {euporie-2.8.9 → euporie-2.8.11}/euporie/console/_settings.py +0 -0
  15. {euporie-2.8.9 → euporie-2.8.11}/euporie/console/app.py +2 -2
  16. {euporie-2.8.9 → euporie-2.8.11}/euporie/console/py.typed +0 -0
  17. {euporie-2.8.9 → euporie-2.8.11}/euporie/console/tabs/__init__.py +0 -0
  18. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/__main__.py +0 -0
  19. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/_settings.py +0 -0
  20. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/__init__.py +0 -0
  21. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/_commands.py +0 -0
  22. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/_settings.py +0 -0
  23. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/app.py +0 -0
  24. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/base.py +0 -0
  25. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/current.py +0 -0
  26. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/cursor.py +0 -0
  27. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/dummy.py +0 -0
  28. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/app/launch.py +0 -0
  29. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/bars/__init__.py +0 -0
  30. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/bars/command.py +0 -0
  31. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/bars/menu.py +0 -0
  32. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/bars/search.py +0 -0
  33. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/bars/status.py +0 -0
  34. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/border.py +0 -0
  35. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/clipboard.py +0 -0
  36. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/comm/__init__.py +0 -0
  37. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/comm/base.py +0 -0
  38. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/comm/ipywidgets.py +0 -0
  39. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/comm/registry.py +0 -0
  40. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/commands.py +0 -0
  41. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/completion.py +0 -0
  42. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/config.py +0 -0
  43. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/__init__.py +0 -0
  44. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/datum.py +0 -0
  45. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/__init__.py +0 -0
  46. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/ansi.py +0 -0
  47. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/base64.py +0 -0
  48. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/common.py +0 -0
  49. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/ft.py +0 -0
  50. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/html.py +0 -0
  51. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/jpeg.py +0 -0
  52. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/markdown.py +0 -0
  53. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/pdf.py +0 -0
  54. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/pil.py +0 -0
  55. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/png.py +0 -0
  56. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/rich.py +0 -0
  57. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/sixel.py +0 -0
  58. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/formats/svg.py +0 -0
  59. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/mime.py +0 -0
  60. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/registry.py +0 -0
  61. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/convert/utils.py +0 -0
  62. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/data_structures.py +0 -0
  63. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/diagnostics.py +0 -0
  64. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/filters.py +0 -0
  65. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/format.py +0 -0
  66. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/ft/__init__.py +0 -0
  67. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/ft/ansi.py +0 -0
  68. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/ft/html.py +0 -0
  69. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/ft/table.py +0 -0
  70. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/ft/utils.py +0 -0
  71. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/graphics.py +0 -0
  72. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/history.py +0 -0
  73. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/inspection.py +0 -0
  74. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/io.py +0 -0
  75. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/kernel/__init__.py +0 -0
  76. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/kernel/base.py +0 -0
  77. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/kernel/jupyter.py +0 -0
  78. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/kernel/jupyter_manager.py +0 -0
  79. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/__init__.py +0 -0
  80. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/bindings/__init__.py +0 -0
  81. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/bindings/basic.py +0 -0
  82. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/bindings/completion.py +0 -0
  83. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/bindings/micro.py +0 -0
  84. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/bindings/mouse.py +0 -0
  85. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/bindings/page_navigation.py +0 -0
  86. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/bindings/terminal.py +0 -0
  87. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/bindings/vi.py +0 -0
  88. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/key_processor.py +0 -0
  89. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/micro_state.py +0 -0
  90. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/registry.py +0 -0
  91. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/utils.py +0 -0
  92. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/key_binding/vi_state.py +0 -0
  93. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/keys.py +0 -0
  94. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/__init__.py +0 -0
  95. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/cache.py +0 -0
  96. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/containers.py +0 -0
  97. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/controls.py +0 -0
  98. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/decor.py +0 -0
  99. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/mouse.py +0 -0
  100. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/print.py +0 -0
  101. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/screen.py +0 -0
  102. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/layout/scroll.py +0 -0
  103. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/lexers.py +0 -0
  104. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/log.py +0 -0
  105. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/lsp.py +0 -0
  106. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/margins.py +0 -0
  107. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/path.py +0 -0
  108. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/processors.py +0 -0
  109. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/py.typed +0 -0
  110. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/pygments.py +0 -0
  111. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/reference.py +0 -0
  112. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/renderer.py +0 -0
  113. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/style.py +0 -0
  114. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/suggest.py +0 -0
  115. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/tabs/__init__.py +0 -0
  116. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/tabs/_commands.py +0 -0
  117. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/tabs/_settings.py +0 -0
  118. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/tabs/base.py +0 -0
  119. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/tabs/kernel.py +0 -0
  120. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/tabs/notebook.py +0 -0
  121. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/utils.py +0 -0
  122. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/validation.py +0 -0
  123. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/__init__.py +0 -0
  124. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/cell.py +0 -0
  125. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/cell_outputs.py +0 -0
  126. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/decor.py +0 -0
  127. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/dialog.py +0 -0
  128. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/display.py +0 -0
  129. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/file_browser.py +0 -0
  130. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/formatted_text_area.py +0 -0
  131. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/forms.py +0 -0
  132. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/layout.py +0 -0
  133. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/logo.py +0 -0
  134. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/menu.py +0 -0
  135. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/pager.py +0 -0
  136. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/palette.py +0 -0
  137. {euporie-2.8.9 → euporie-2.8.11}/euporie/core/widgets/tree.py +0 -0
  138. {euporie-2.8.9 → euporie-2.8.11}/euporie/data/desktop/euporie-console.desktop +0 -0
  139. {euporie-2.8.9 → euporie-2.8.11}/euporie/data/desktop/euporie-notebook.desktop +0 -0
  140. {euporie-2.8.9 → euporie-2.8.11}/euporie/hub/__init__.py +0 -0
  141. {euporie-2.8.9 → euporie-2.8.11}/euporie/hub/__main__.py +0 -0
  142. {euporie-2.8.9 → euporie-2.8.11}/euporie/hub/app.py +0 -0
  143. {euporie-2.8.9 → euporie-2.8.11}/euporie/hub/py.typed +0 -0
  144. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/__init__.py +0 -0
  145. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/__main__.py +0 -0
  146. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/_commands.py +0 -0
  147. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/_settings.py +0 -0
  148. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/app.py +0 -0
  149. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/current.py +0 -0
  150. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/enums.py +0 -0
  151. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/filters.py +0 -0
  152. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/py.typed +0 -0
  153. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/tabs/__init__.py +0 -0
  154. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/tabs/_commands.py +0 -0
  155. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/tabs/_settings.py +0 -0
  156. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/tabs/display.py +0 -0
  157. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/tabs/edit.py +0 -0
  158. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/tabs/json.py +0 -0
  159. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/tabs/log.py +0 -0
  160. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/tabs/notebook.py +0 -0
  161. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/widgets/__init__.py +0 -0
  162. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/widgets/_commands.py +0 -0
  163. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/widgets/_settings.py +0 -0
  164. {euporie-2.8.9 → euporie-2.8.11}/euporie/notebook/widgets/side_bar.py +0 -0
  165. {euporie-2.8.9 → euporie-2.8.11}/euporie/preview/__init__.py +0 -0
  166. {euporie-2.8.9 → euporie-2.8.11}/euporie/preview/__main__.py +0 -0
  167. {euporie-2.8.9 → euporie-2.8.11}/euporie/preview/_settings.py +0 -0
  168. {euporie-2.8.9 → euporie-2.8.11}/euporie/preview/app.py +0 -0
  169. {euporie-2.8.9 → euporie-2.8.11}/euporie/preview/py.typed +0 -0
  170. {euporie-2.8.9 → euporie-2.8.11}/euporie/preview/tabs/__init__.py +0 -0
  171. {euporie-2.8.9 → euporie-2.8.11}/euporie/preview/tabs/notebook.py +0 -0
  172. {euporie-2.8.9 → euporie-2.8.11}/euporie/web/__init__.py +0 -0
  173. {euporie-2.8.9 → euporie-2.8.11}/euporie/web/tabs/__init__.py +0 -0
  174. {euporie-2.8.9 → euporie-2.8.11}/euporie/web/tabs/web.py +0 -0
  175. {euporie-2.8.9 → euporie-2.8.11}/euporie/web/widgets/__init__.py +0 -0
  176. {euporie-2.8.9 → euporie-2.8.11}/euporie/web/widgets/webview.py +0 -0
  177. {euporie-2.8.9 → euporie-2.8.11}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euporie
3
- Version: 2.8.9
3
+ Version: 2.8.11
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
@@ -638,7 +638,10 @@ class Console(KernelTab):
638
638
  Window(
639
639
  FormattedTextControl(
640
640
  lambda: self.prompt(
641
- "In ", self.execution_count, offset=1
641
+ "In ",
642
+ self.execution_count,
643
+ offset=1,
644
+ show_busy=True,
642
645
  )
643
646
  ),
644
647
  dont_extend_width=True,
@@ -1,7 +1,7 @@
1
1
  """This package defines the euporie application and its components."""
2
2
 
3
3
  __app_name__ = "euporie"
4
- __version__ = "2.8.9"
4
+ __version__ = "2.8.11"
5
5
  __logo__ = "⚈"
6
6
  __strapline__ = "Jupyter in the terminal"
7
7
  __author__ = "Josiah Outram Halstead"
@@ -0,0 +1,24 @@
1
+ """Defines kernel settings."""
2
+
3
+ from euporie.core.config import add_setting
4
+
5
+ add_setting(
6
+ name="warn_venv",
7
+ # Kernel implementations are loaded lazily, so we add kernel settings to the root
8
+ # kernel module group, causing them to get loaded before any kernel implementations
9
+ group="euporie.core.kernel",
10
+ flags=["--warn-venv"],
11
+ type_=bool,
12
+ default=True,
13
+ help_="Warn when running in a virtual environment",
14
+ description="""
15
+ When enabled, displays a warning message when the kernel is running inside a
16
+ virtual environment.
17
+
18
+ This can be helpful to remind users that they are working in an isolated Python
19
+ environment with potentially different package versions than their system Python
20
+ installation.
21
+
22
+ Disable this setting if you prefer not to see these warnings.
23
+ """,
24
+ )
@@ -6,12 +6,14 @@ import ast
6
6
  import code
7
7
  import getpass
8
8
  import logging
9
+ import os
9
10
  import sys
10
11
  import threading
11
12
  import traceback
12
13
  from asyncio import to_thread
13
14
  from functools import update_wrapper
14
15
  from linecache import cache as line_cache
16
+ from pathlib import Path
15
17
  from typing import TYPE_CHECKING, cast
16
18
 
17
19
  from pygments import highlight
@@ -124,6 +126,77 @@ class LocalPythonKernel(BaseKernel):
124
126
  if callable(set_status):
125
127
  set_status(self.status)
126
128
 
129
+ def init_venv(self) -> None:
130
+ """Add the current venv to sys.path so we can import modules from it.
131
+
132
+ This isn't perfect: it doesn't use the Python interpreter with which the
133
+ virtualenv was built, and it ignores the --no-site-packages option. A warning
134
+ will appear suggesting the user installs euporie in the virtualenv or to use a
135
+ Jupyter kernel, but for many cases, it probably works well enough.
136
+
137
+ Adapted from :py:mod:`IPython`.
138
+ """
139
+ # Check if we are in a virtual environment
140
+ if "VIRTUAL_ENV" not in os.environ:
141
+ return
142
+ elif os.environ["VIRTUAL_ENV"] == "":
143
+ log.warning(
144
+ "The virtual environment path is set to '': "
145
+ "please check if this is intentional."
146
+ )
147
+ return
148
+
149
+ # Follow sys.executable symlink trail, recoding all paths along the way
150
+ # We need to check all of these
151
+ paths = [Path(sys.executable)]
152
+ while (path := paths[-1]).is_symlink():
153
+ new_path = path.readlink()
154
+ if not new_path.is_absolute():
155
+ new_path = path.parent / new_path
156
+ paths.append(new_path)
157
+
158
+ # Get the venv path
159
+ p_venv = Path(os.environ["VIRTUAL_ENV"]).resolve()
160
+ # In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible
161
+ if len(p_venv.parts) > 2 and p_venv.parts[1] == "cygdrive":
162
+ drive_name = p_venv.parts[2]
163
+ p_venv = (drive_name + ":/") / Path(*p_venv.parts[3:])
164
+
165
+ # Check if the executable is already inside or has access to the virtualenv
166
+ if any(p_venv == p.parents[1].resolve() for p in paths):
167
+ return
168
+
169
+ # Locate the site-packages of the virtual environment
170
+ if sys.platform == "win32":
171
+ virtual_env = str(Path(os.environ["VIRTUAL_ENV"], "Lib", "site-packages"))
172
+ else:
173
+ import re
174
+
175
+ virtual_env_path = Path(
176
+ os.environ["VIRTUAL_ENV"], "lib", "python{}.{}", "site-packages"
177
+ )
178
+ p_ver = sys.version_info[:2]
179
+
180
+ # Predict version from py[thon]-x.x in the $VIRTUAL_ENV
181
+ re_m = re.search(r"\bpy(?:thon)?([23])\.(\d+)\b", os.environ["VIRTUAL_ENV"])
182
+ if re_m:
183
+ predicted_path = Path(str(virtual_env_path).format(*re_m.groups()))
184
+ if predicted_path.exists():
185
+ p_ver = re_m.groups()
186
+
187
+ virtual_env = str(virtual_env_path).format(*p_ver)
188
+
189
+ if self.kernel_tab.app.config.warn_venv:
190
+ log.warning("Attempting to work in virtualenv %r.", virtual_env)
191
+ log.warning(
192
+ "If you encounter problems, please install euporie inside the virtual "
193
+ "environment, or use a Jupyter kernel."
194
+ )
195
+ import site
196
+
197
+ sys.path.insert(0, virtual_env)
198
+ site.addsitedir(virtual_env)
199
+
127
200
  async def start_async(self) -> None:
128
201
  """Start the local interpreter."""
129
202
  self.error = None
@@ -134,6 +207,7 @@ class LocalPythonKernel(BaseKernel):
134
207
  set_execution_count := self.default_callbacks.get("set_execution_count")
135
208
  ):
136
209
  set_execution_count(self.execution_count)
210
+ self.init_venv()
137
211
 
138
212
  @property
139
213
  def spec(self) -> dict[str, str]:
@@ -177,7 +251,7 @@ class LocalPythonKernel(BaseKernel):
177
251
  colored_traceback = highlight(
178
252
  traceback_text,
179
253
  Python3TracebackLexer(),
180
- Terminal256Formatter(style=get_app().config.syntax_theme),
254
+ Terminal256Formatter(style=self.kernel_tab.app.config.syntax_theme),
181
255
  ).rstrip()
182
256
 
183
257
  # Send the error through the callback
@@ -4,6 +4,7 @@ from prompt_toolkit.filters import buffer_has_focus
4
4
 
5
5
  from euporie.core.app.current import get_app
6
6
  from euporie.core.config import add_setting
7
+ from euporie.core.filters import tab_type_has_focus
7
8
 
8
9
  # euporie.core.widgets.cell_outputs:CellOutputArea
9
10
 
@@ -14,12 +15,16 @@ add_setting(
14
15
  flags=["--wrap-cell-outputs"],
15
16
  type_=bool,
16
17
  help_="Wrap cell output text.",
17
- default=False,
18
+ default=True,
18
19
  schema={"type": "boolean"},
19
20
  description="""
20
21
  Whether text-based cell outputs should be wrapped.
21
22
  """,
22
- cmd_filter=~buffer_has_focus,
23
+ cmd_filter=(
24
+ ~buffer_has_focus
25
+ & tab_type_has_focus("euporie.notebook.tabs.notebook.Notebook")
26
+ )
27
+ | ~tab_type_has_focus("euporie.notebook.tabs.notebook.Notebook"),
23
28
  )
24
29
 
25
30
  add_setting(
@@ -360,7 +360,7 @@ class KernelInput(TextArea):
360
360
 
361
361
  def reformat(self) -> None:
362
362
  """Reformat the cell's input."""
363
- original_text = self.buffer.text
363
+ original_text = new_text = self.buffer.text
364
364
  language = self.language
365
365
  for formatter in self.formatters:
366
366
  new_text = formatter._format(original_text, language)
File without changes
File without changes
File without changes
@@ -101,8 +101,6 @@ class ConsoleApp(BaseApp):
101
101
 
102
102
  def load_container(self) -> FloatContainer:
103
103
  """Return a container with all opened tabs."""
104
- self.tabs = [Console(self)]
105
-
106
104
  self.command_bar = CommandBar()
107
105
  self.search_bar = SearchBar()
108
106
  self.pager = Pager()
@@ -115,6 +113,8 @@ class ConsoleApp(BaseApp):
115
113
  self.dialogs["shortcuts"] = ShortcutsDialog(self)
116
114
  self.dialogs["confirm"] = ConfirmDialog(self)
117
115
 
116
+ self.tabs = [Console(self)]
117
+
118
118
  return FloatContainer(
119
119
  DisableMouseOnScroll(
120
120
  HSplit(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes