ImportError checking and kill process after completion
This commit is contained in:
parent
30bfb9ac88
commit
c7bfb0a2e7
1 changed files with 18 additions and 3 deletions
|
@ -1,10 +1,25 @@
|
||||||
import gen_cli_docs
|
|
||||||
import gen_api_docs
|
|
||||||
import os.path as op
|
import os.path as op
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
try:
|
||||||
|
import mkdocs
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError("mkdocs is not installed")
|
||||||
|
|
||||||
|
try:
|
||||||
|
import tabulate
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError("tabulate is not installed")
|
||||||
|
|
||||||
|
try:
|
||||||
|
import gen_cli_docs
|
||||||
|
import gen_api_docs
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError("Probably not inside the lbry's virtual environment or daemon not installed")
|
||||||
|
|
||||||
gen_cli_docs.main()
|
gen_cli_docs.main()
|
||||||
gen_api_docs.main()
|
gen_api_docs.main()
|
||||||
cwd = op.dirname(op.realpath(__file__))
|
cwd = op.dirname(op.realpath(__file__))
|
||||||
cwd = op.realpath(op.join(cwd, ".."))
|
cwd = op.realpath(op.join(cwd, ".."))
|
||||||
proc = subprocess.Popen("mkdocs build", cwd=cwd, shell=True)
|
proc = subprocess.Popen("exec mkdocs build", cwd=cwd, shell=True)
|
||||||
|
proc.kill()
|
||||||
|
|
Loading…
Reference in a new issue