@@ -216,27 +216,24 @@ def _filter_magics(self, code):
216
216
217
217
# Supported by using Jupyter
218
218
def _find_local_header (self ):
219
-
220
- import sys
221
- from os .path import abspath , dirname , exists , join , split
222
-
223
- path = abspath (dirname (__file__ ))
219
+ path = path .abspath (path .dirname (__file__ ))
224
220
starting_points = [path ]
225
221
if not path .startswith (sys .prefix ):
226
222
starting_points .append (sys .prefix )
227
223
for path in starting_points :
228
224
while path != '/' :
229
- share_jupyterhub = join (path , 'share' , 'cpp_header' )
230
- if all (exists (join (share_jupyterhub , f )) for f in ['check_cpp.hpp' ]):
225
+ share_jupyterhub = path . join (path , 'share' , 'cpp_header' )
226
+ if all (path . exists (path . join (share_jupyterhub , f )) for f in ['check_cpp.hpp' ]):
231
227
return share_jupyterhub
232
- path , _ = split (path )
228
+ path , _ = path . split (path )
233
229
# didn't find it, give up
234
230
return ''
235
231
236
232
def _support_external_header (self , code ):
237
233
DATA_FILES_PATH = self ._find_local_header ()
234
+ code = ""
238
235
for file in os .listdir (DATA_FILES_PATH ):
239
- path_to_header = DATA_FILES_PATH + "/" + file
236
+ path_to_header = os . path . join ( DATA_FILES_PATH , file )
240
237
if os .path .isdir (path_to_header ):
241
238
pass
242
239
elif os .path .isfile (path_to_header ):
0 commit comments