-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ab693f
commit 94de7d7
Showing
1 changed file
with
11 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
import panel as pn | ||
from IPython import get_ipython | ||
|
||
# Initialize Panel extension | ||
pn.extension() | ||
from .telemetry import telemetry | ||
|
||
# Import your telemetry | ||
try: | ||
from pykubegrader.telemetry import telemetry | ||
except ImportError: | ||
telemetry = None | ||
print("Telemetry module not found. Ensure it is installed and accessible.") | ||
|
||
# Check if in a Jupyter environment and set up pre-run event | ||
# Check if in a Jupyter environment | ||
ipython = get_ipython() | ||
if ipython and telemetry: | ||
|
||
if ipython is not None: | ||
# Initialize Panel extension | ||
pn.extension() | ||
|
||
# Register telemetry with pre_run_cell event | ||
ipython.events.register("pre_run_cell", telemetry) | ||
print("Telemetry registered with pre_run_cell event.") | ||
|
||
print("Setup completed successfully") | ||
else: | ||
print("Not in a Jupyter environment or telemetry unavailable.") | ||
print("Setup unsuccessful. Are you in a Jupyter environment?") |