@@ -68,15 +68,15 @@ def find_free_port():
68
68
pass
69
69
70
70
71
- if 'nbextensions' in os .listdir (jd ):
71
+ if ( 'nbextensions' in os .listdir (jd )) and ( notebook . __version__ <= '6.5.5' ):
72
72
ldir = os .listdir (nbdir )
73
73
if ('vpython_data' in ldir and len (os .listdir (nbdata )) == datacnt and
74
74
'vpython_libraries' in ldir and len (os .listdir (nblib )) == libcnt and
75
75
'vpython_version.txt' in ldir ):
76
76
v = open (nbdir + '/vpython_version.txt' ).read ()
77
77
transfer = (v != __version__ ) # need not transfer files to nbextensions if correct version's files already there
78
78
79
- if transfer :
79
+ if transfer and ( notebook . __version__ <= '6.5.5' ) :
80
80
notebook .nbextensions .install_nbextension (path = package_dir + "/vpython_data" ,overwrite = True ,user = True ,verbose = 0 )
81
81
notebook .nbextensions .install_nbextension (path = package_dir + "/vpython_libraries" ,overwrite = True ,user = True ,verbose = 0 )
82
82
@@ -98,15 +98,16 @@ def find_free_port():
98
98
fd .write (__version__ )
99
99
fd .close ()
100
100
101
- display (Javascript ("""if (typeof Jupyter !== "undefined") {require.undef("nbextensions/vpython_libraries/glow.min");}else{element.textContent = ' ';}""" ))
102
- display (Javascript ("""if (typeof Jupyter !== "undefined") {require.undef("nbextensions/vpython_libraries/glowcomm");}else{element.textContent = ' ';}""" ))
103
- display (Javascript ("""if (typeof Jupyter !== "undefined") {require.undef("nbextensions/vpython_libraries/jquery-ui.custom.min");}else{element.textContent = ' ';}""" ))
101
+ if ('nbextensions' in os .listdir (jd )) and (notebook .__version__ <= '6.5.5' ):
102
+ display (Javascript ("""if (typeof Jupyter !== "undefined") {require.undef("nbextensions/vpython_libraries/glow.min");}else{element.textContent = ' ';}""" ))
103
+ display (Javascript ("""if (typeof Jupyter !== "undefined") {require.undef("nbextensions/vpython_libraries/glowcomm");}else{element.textContent = ' ';}""" ))
104
+ display (Javascript ("""if (typeof Jupyter !== "undefined") {require.undef("nbextensions/vpython_libraries/jquery-ui.custom.min");}else{element.textContent = ' ';}""" ))
104
105
105
- display (Javascript ("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/glow.min"], function(){console.log("GLOW LOADED");});}else{element.textContent = ' ';}""" ))
106
- display (Javascript ("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/glowcomm"], function(){console.log("GLOWCOMM LOADED");});}else{element.textContent = ' ';}""" ))
107
- display (Javascript ("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/jquery-ui.custom.min"], function(){console.log("JQUERY LOADED");});}else{element.textContent = ' ';}""" ))
106
+ display (Javascript ("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/glow.min"], function(){console.log("GLOW LOADED");});}else{element.textContent = ' ';}""" ))
107
+ display (Javascript ("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/glowcomm"], function(){console.log("GLOWCOMM LOADED");});}else{element.textContent = ' ';}""" ))
108
+ display (Javascript ("""if (typeof Jupyter !== "undefined") {require(["nbextensions/vpython_libraries/jquery-ui.custom.min"], function(){console.log("JQUERY LOADED");});}else{element.textContent = ' ';}""" ))
108
109
109
- if transfer :
110
+ if transfer and ( notebook . __version__ <= '6.5.5' ) :
110
111
time .sleep (4 ) # allow some time for javascript code above to run after nbextensions update before attempting to setup Comm Channel
111
112
else :
112
113
time .sleep (2 ) # allow some time for javascript code above to run before attempting to setup Comm Channel
0 commit comments