Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
neoppod
Commits
4a52bd98
Commit
4a52bd98
authored
Dec 28, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qa: rewrite tools/coverage-html in Python to make -d option usable
parent
7a75daa9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
tools/coverage-html
tools/coverage-html
+20
-9
No files found.
tools/coverage-html
View file @
4a52bd98
#!/bin/sh -e
#!/usr/bin/env python
for
COV
in
coverage python-coverage
import
os
,
re
,
sys
,
shutil
do
type
$COV
&&
break
from
coverage.cmdline
import
main
,
CmdOptionParser
done
>
/dev/null 2>&1
||
exit
sys
.
argv
.
insert
(
1
,
'html'
)
del
CmdOptionParser
.
get_prog_name
$COV
html
"
$@
"
# https://bitbucket.org/ned/coveragepy/issues/474/javascript-in-html-captures-all-keys
# https://bitbucket.org/ned/coveragepy/issues/474/javascript-in-html-captures-all-keys
sed
-i
"
shutil_copyfile
=
shutil
.
copyfile
/assign_shortkeys *=/s/
$/
return;/
def
copyfile
(
src
,
dst
):
/^ *
\.
bind('keydown',/s,^,//,
if
os
.
path
.
basename
(
dst
)
==
'coverage_html.js'
:
"
htmlcov/coverage_html.js
with
open
(
src
)
as
f
:
js
=
f
.
read
()
js
=
re
.
sub
(
r"(assign_shortkeys.*\
{)
", r"
\
1
return
;
", js)
js = re.sub(r"
^
(
*
\
.
bind
\
(
'keydown'
,)
", r"
//
\
1
", js, flags=re.M)
with open(dst, 'w') as f:
f.write(js)
else:
shutil_copyfile(src, dst)
shutil.copyfile = copyfile
main()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment