9 getpyver(python_path) --> python_version
12 getpyver("python3") --> "3.2"
15 p
= subprocess
.Popen((cmd
, "--version"), stderr
=subprocess
.PIPE
)
18 p
= p
.stderr
.read().decode('ascii')
19 p
= p
.split()[1].split('.')
20 return p
[0] + '.' + p
[1]
22 def get_python_path(cmd
):
24 return ("/usr/lib/python{}/site-packages".format(pyv
) if pyv
else None)
27 path
= get_python_path(cmd
)
28 if os
.path
.isdir(os
.path
.join(path
, "sphinx")):
35 return check("python3")
37 return check("python2")
38 raise RuntimeError("It seems that you have not install sphinx yet.")
42 breathedir
= os
.path
.join(srcdir
, "breathe")
44 insdir
= os
.path
.join(pkgdir
, copy_location()[1:])
45 insdir
= os
.path
.join(insdir
, "breathe")
47 docdir
= os
.path
.join(pkgdir
, "usr/share/doc/python-sphinx-breathe")
48 htmldir
= os
.path
.join(srcdir
,"testsuite/build/html")
49 shutil
.move(breathedir
, insdir
)
50 shutil
.move(htmldir
, docdir
)