Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

""" 

@file 

@brief Helpers around paths 

""" 

 

import os 

 

#: default value for d3js 

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

 

 

def local_d3js(default=default_d3js): 

""" 

try to find a local copy of d3js 

 

@param default use this value otherwise 

@return location of d3.min.js 

 

@todo Check about local d3.js 

""" 

return default 

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

 

# the local version does not seem to work 

# to be checked later 

import ipython 

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

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

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

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

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

if os.path.exists(ff): 

return f 

return default