Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
74fff22f
Commit
74fff22f
authored
Dec 01, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix annotation score calculation
parent
ed6ef5ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Cython/Compiler/Annotate.py
Cython/Compiler/Annotate.py
+4
-3
No files found.
Cython/Compiler/Annotate.py
View file @
74fff22f
...
...
@@ -132,8 +132,8 @@ function toggleDiv(id) {
c_file
=
Utils
.
decode_filename
(
os
.
path
.
basename
(
target_filename
))
f
.
write
(
u'<p>Raw output: <a href="%s">%s</a>
\
n
'
%
(
c_file
,
c_file
))
calls
=
dict
((
name
,
0
)
for
name
in
'refnanny py_macro_api py_c_api pyx_macro_api pyx_c_api error_goto'
.
split
())
zero_
calls
=
dict
((
name
,
0
)
for
name
in
'refnanny py_macro_api py_c_api pyx_macro_api pyx_c_api error_goto'
.
split
())
def
annotate
(
match
):
group_name
=
match
.
lastgroup
...
...
@@ -152,9 +152,10 @@ function toggleDiv(id) {
else
:
code
=
html_escape
(
code
)
calls
=
zero_calls
.
copy
()
code
=
_parse_code
(
annotate
,
code
)
score
=
(
5
*
calls
[
'py_c_api'
]
+
2
*
calls
[
'pyx_c_api'
]
+
calls
[
'py_macro_api'
]
+
calls
[
'pyx_macro_api'
]
-
calls
[
'refnanny'
]
)
calls
[
'py_macro_api'
]
+
calls
[
'pyx_macro_api'
])
color
=
u"FFFF%02x"
%
int
(
255
/
(
1
+
score
/
10.0
))
f
.
write
(
u"<pre class='line' style='background-color: #%s' onclick='toggleDiv(
\
"
line%s
\
"
)'>"
%
(
color
,
k
))
...
...
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