Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsoncpp
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
le
jsoncpp
Commits
bb0c80b3
Commit
bb0c80b3
authored
10 years ago
by
Florian Meier
Committed by
Christopher Dunn
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Doxybuild: Error message if doxygen not found
This patch introduces a better error message. See discussion at pull #129.
parent
ff5abe76
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doxybuild.py
+23
-7
23 additions, 7 deletions
doxybuild.py
with
23 additions
and
7 deletions
doxybuild.py
+
23
−
7
View file @
bb0c80b3
...
...
@@ -4,6 +4,7 @@ from __future__ import print_function
from
devtools
import
tarball
from
contextlib
import
contextmanager
import
subprocess
import
traceback
import
re
import
os
import
sys
...
...
@@ -52,24 +53,39 @@ def do_subst_in_file(targetfile, sourcefile, dict):
def
getstatusoutput
(
cmd
):
"""
cmd is a list.
"""
process
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
output
,
_
=
process
.
communicate
()
status
=
process
.
returncode
try
:
process
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
output
,
_
=
process
.
communicate
()
status
=
process
.
returncode
except
:
status
=
-
1
output
=
traceback
.
format_exc
()
return
status
,
output
def
run_cmd
(
cmd
,
silent
=
False
):
print
(
'
Running:
'
,
repr
(
'
'
.
join
(
cmd
)),
'
in
'
,
repr
(
os
.
getcwd
()))
"""
Raise exception on failure.
"""
info
=
'
Running: %r in %r
'
%
(
'
'
.
join
(
cmd
),
os
.
getcwd
())
print
(
info
)
sys
.
stdout
.
flush
()
if
silent
:
status
,
output
=
getstatusoutput
(
cmd
)
else
:
status
,
output
=
os
.
system
(
'
'
.
join
(
cmd
)),
''
if
status
:
msg
=
'
error=%d, output=
"""
\n
%s
\n
"""'
%
(
status
,
output
)
print
(
msg
)
#raise Exception(msg)
msg
=
'
Error while %s ...
\n\t
error=%d, output=
"""
%s
"""'
%
(
info
,
status
,
output
)
raise
Exception
(
msg
)
def
assert_is_exe
(
path
):
if
not
path
:
raise
Exception
(
'
path is empty.
'
)
if
not
os
.
path
.
isfile
(
path
):
raise
Exception
(
'
%r is not a file.
'
%
path
)
if
not
os
.
access
(
path
,
os
.
X_OK
):
raise
Exception
(
'
%r is not executable by this user.
'
%
path
)
def
run_doxygen
(
doxygen_path
,
config_file
,
working_dir
,
is_silent
):
assert_is_exe
(
doxygen_path
)
config_file
=
os
.
path
.
abspath
(
config_file
)
with
cd
(
working_dir
):
cmd
=
[
doxygen_path
,
config_file
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment