File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,15 @@ def find_free_port():
58
58
if jupyterlab .__version__ >= '0.35.0' :
59
59
from os .path import join
60
60
labextensions_dir = join (jupyterlab .commands .get_app_dir (), u'static' )
61
- notebook .nbextensions .install_nbextension (path = package_dir + "/vpython_data" ,
62
- nbextensions_dir = labextensions_dir ,
63
- overwrite = False ,
64
- verbose = 0 )
61
+ try :
62
+ notebook .nbextensions .install_nbextension (path = package_dir + "/vpython_data" ,
63
+ nbextensions_dir = labextensions_dir ,
64
+ overwrite = False ,
65
+ verbose = 0 )
66
+ except PermissionError :
67
+ #logging.info("PermissionError: Unable to install /vpython_data directory and files for VPython on JupyterLab")
68
+ pass
69
+
65
70
66
71
if 'nbextensions' in os .listdir (jd ):
67
72
ldir = os .listdir (nbdir )
@@ -101,7 +106,10 @@ def find_free_port():
101
106
display (Javascript ("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/glowcomm"], function(){console.log("GLOWCOMM LOADED");});}else{element.textContent = ' ';}""" ))
102
107
display (Javascript ("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/jquery-ui.custom.min"], function(){console.log("JQUERY LOADED");});}else{element.textContent = ' ';}""" ))
103
108
104
- time .sleep (1 ) # allow some time for javascript code above to run before attempting to setup Comm Channel
109
+ if transfer :
110
+ time .sleep (4 ) # allow some time for javascript code above to run after nbextensions update before attempting to setup Comm Channel
111
+ else :
112
+ time .sleep (2 ) # allow some time for javascript code above to run before attempting to setup Comm Channel
105
113
106
114
wsConnected = False
107
115
You can’t perform that action at this time.
0 commit comments