Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Cython
vpython
jupyter-server-proxy
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import versioneer

install_requires = ['jupyter', 'numpy', 'ipykernel',
install_requires = ['jupyter', 'jupyter-server-proxy', 'numpy', 'ipykernel',
'autobahn>=18.8.2']

if sys.version_info.major == 3 and sys.version_info.minor >= 5:
Expand Down
18 changes: 13 additions & 5 deletions vpython/with_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,15 @@ def find_free_port():
if jupyterlab.__version__ >= '0.35.0':
from os.path import join
labextensions_dir = join(jupyterlab.commands.get_app_dir(), u'static')
notebook.nbextensions.install_nbextension(path=package_dir + "/vpython_data",
nbextensions_dir=labextensions_dir,
overwrite=False,
verbose=0)
try:
notebook.nbextensions.install_nbextension(path=package_dir + "/vpython_data",
nbextensions_dir=labextensions_dir,
overwrite=False,
verbose=0)
except PermissionError:
#logging.info("PermissionError: Unable to install /vpython_data directory and files for VPython on JupyterLab")
pass


if 'nbextensions' in os.listdir(jd):
ldir = os.listdir(nbdir)
Expand Down Expand Up @@ -101,7 +106,10 @@ def find_free_port():
display(Javascript("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/glowcomm"], function(){console.log("GLOWCOMM LOADED");});}else{element.textContent = ' ';}"""))
display(Javascript("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/jquery-ui.custom.min"], function(){console.log("JQUERY LOADED");});}else{element.textContent = ' ';}"""))

time.sleep(1) # allow some time for javascript code above to run before attempting to setup Comm Channel
if transfer:
time.sleep(4) # allow some time for javascript code above to run after nbextensions update before attempting to setup Comm Channel
else:
time.sleep(2) # allow some time for javascript code above to run before attempting to setup Comm Channel

wsConnected = False

Expand Down