Coverage for src/code_beatrix/ipythonhelper/path_helper.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.1.0, created at 2023-04-29 13:45 +0200

1""" 

2@file 

3@brief Helpers around paths 

4""" 

5 

6#: default value for d3js 

7default_d3js = "http://rawgithub.com/mbostock/d3/master/d3.min.js" 

8 

9 

10def local_d3js(default=default_d3js): 

11 """ 

12 try to find a local copy of d3js 

13 

14 @param default use this value otherwise 

15 @return location of d3.min.js 

16 

17 @todo Check about local d3.js 

18 """ 

19 return default 

20 # return "/static/d3js/d3.v3.min.js" 

21 

22 # the local version does not seem to work 

23 # to be checked later 

24 # import ipython 

25 # pyt = os.path.dirname(ipython.__file__) 

26 # pack = os.path.join(pyt, "html") 

27 # for f in ["/static/d3js/d3.min.js", 

28 # "/static/d3js/d3.v3.min.js", ]: 

29 # ff = os.path.join(pack, f) 

30 # if os.path.exists(ff): 

31 # return f 

32 # return default