-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
render plots inline in notebook sessions (#2721)
Plus some minor general housekeeping.
- Loading branch information
Showing
10 changed files
with
205 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
extensions/positron-python/python_files/positron/positron_ipykernel/session_mode.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Copyright (C) 2023-2024 Posit Software, PBC. All rights reserved. | ||
# | ||
|
||
import enum | ||
|
||
import traitlets | ||
|
||
|
||
class SessionMode(str, enum.Enum): | ||
""" | ||
The mode that the kernel application was started in. | ||
""" | ||
|
||
CONSOLE = "console" | ||
NOTEBOOK = "notebook" | ||
BACKGROUND = "background" | ||
|
||
DEFAULT = CONSOLE | ||
|
||
def __str__(self) -> str: | ||
# Override for better display in argparse help. | ||
return self.value | ||
|
||
@classmethod | ||
def trait(cls) -> traitlets.Enum: | ||
return traitlets.Enum(sorted(cls), help=cls.__doc__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.