Skip to content

Commit

Permalink
Do not patch PTK unless launching a euporie app
Browse files Browse the repository at this point in the history
  • Loading branch information
joouha committed May 13, 2024
1 parent 4729e31 commit 78d09b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Added
Fixed
=====

- Only patch `prompt_toolkit` when an app is launched, not at import
- Ensure all key-bindings are configurable (thanks @matheusfillipe)
- Fix rare bug causing exception when notebook has no cells
- Prevent race condition causing duplicate cells at startup
- Mark notebook as modified when changing cell type
Expand Down
8 changes: 0 additions & 8 deletions euporie/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,3 @@
__email__ = "[email protected]"
__copyright__ = f"© 2024, {__author__}"
__license__ = "MIT"


# Register extensions to external packages
from euporie.core import path # noqa F401
from euporie.core import pygments # noqa F401

# Monkey-patch prompt_toolkit
from euporie.core.layout import containers # noqa: F401
9 changes: 9 additions & 0 deletions euporie/core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ def main(name: "str" = "launch") -> "None":
"""Load and launches the application."""
from importlib.metadata import entry_points

# Register extensions to external packages
from euporie.core import (
path, # noqa F401
pygments, # noqa F401
)

# Monkey-patch prompt_toolkit
from euporie.core.layout import containers # noqa: F401

eps = entry_points() # group="euporie.apps")
if isinstance(eps, dict):
points = eps.get("euporie.apps")
Expand Down

0 comments on commit 78d09b1

Please sign in to comment.