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
3bd01d65
Commit
3bd01d65
authored
Apr 23, 2014
by
Matthias BUSSONNIER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unique class name to avoid conflic
in particular tings like 'code' are conflicting when embeding the page
parent
d71cc134
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
Cython/Compiler/Annotate.py
Cython/Compiler/Annotate.py
+18
-18
No files found.
Cython/Compiler/Annotate.py
View file @
3bd01d65
...
@@ -73,26 +73,26 @@ function toggleDiv(id) {
...
@@ -73,26 +73,26 @@ function toggleDiv(id) {
body { font-family: courier; font-size: 12; }
body { font-family: courier; font-size: 12; }
.code { font-size: 9; color: #444444; display: none; margin-left: 20px; }
.c
ython .c
ode { font-size: 9; color: #444444; display: none; margin-left: 20px; }
.py_c_api { color: red; }
.
cython .
py_c_api { color: red; }
.py_macro_api { color: #FF7000; }
.
cython .
py_macro_api { color: #FF7000; }
.pyx_c_api { color: #FF3000; }
.
cython .
pyx_c_api { color: #FF3000; }
.pyx_macro_api { color: #FF7000; }
.
cython .
pyx_macro_api { color: #FF7000; }
.refnanny { color: #FFA000; }
.
cython .
refnanny { color: #FFA000; }
.error_goto { color: #FFA000; }
.
cython .
error_goto { color: #FFA000; }
.tag { }
.
cython .
tag { }
.coerce { color: #008000; border: 1px dotted #008000 }
.c
ython .c
oerce { color: #008000; border: 1px dotted #008000 }
.py_attr { color: #FF0000; font-weight: bold; }
.
cython .
py_attr { color: #FF0000; font-weight: bold; }
.c_attr { color: #0000FF; }
.c
ython .c
_attr { color: #0000FF; }
.py_call { color: #FF0000; font-weight: bold; }
.
cython .
py_call { color: #FF0000; font-weight: bold; }
.c_call { color: #0000FF; }
.c
ython .c
_call { color: #0000FF; }
.line { margin: 0em }
.
cython .
line { margin: 0em }
"""
"""
...
@@ -164,7 +164,7 @@ body { font-family: courier; font-size: 12; }
...
@@ -164,7 +164,7 @@ body { font-family: courier; font-size: 12; }
def
annotate
(
match
):
def
annotate
(
match
):
group_name
=
match
.
lastgroup
group_name
=
match
.
lastgroup
calls
[
group_name
]
+=
1
calls
[
group_name
]
+=
1
return
ur"<span class='%s'>%s</span>"
%
(
return
ur"<span class='
cython
%s'>%s</span>"
%
(
group_name
,
match
.
group
(
group_name
))
group_name
,
match
.
group
(
group_name
))
pos_comment_marker
=
u'/*
\
N{HORIZONTAL ELLIPSIS}
*/
\
n
'
pos_comment_marker
=
u'/*
\
N{HORIZONTAL ELLIPSIS}
*/
\
n
'
...
@@ -187,7 +187,7 @@ body { font-family: courier; font-size: 12; }
...
@@ -187,7 +187,7 @@ body { font-family: courier; font-size: 12; }
score
=
(
5
*
calls
[
'py_c_api'
]
+
2
*
calls
[
'pyx_c_api'
]
+
score
=
(
5
*
calls
[
'py_c_api'
]
+
2
*
calls
[
'pyx_c_api'
]
+
calls
[
'py_macro_api'
]
+
calls
[
'pyx_macro_api'
])
calls
[
'py_macro_api'
]
+
calls
[
'pyx_macro_api'
])
color
=
u"FFFF%02x"
%
int
(
255
/
(
1
+
score
/
10.0
))
color
=
u"FFFF%02x"
%
int
(
255
/
(
1
+
score
/
10.0
))
outlist
.
append
(
u"<pre class='line' style='background-color: #%s' onclick='toggleDiv(
\
"
line%s
\
"
)'>"
%
(
color
,
k
))
outlist
.
append
(
u"<pre class='
cython
line' style='background-color: #%s' onclick='toggleDiv(
\
"
line%s
\
"
)'>"
%
(
color
,
k
))
outlist
.
append
(
u" %d: "
%
k
)
outlist
.
append
(
u" %d: "
%
k
)
for
c
,
cc
,
html
in
special_chars
:
for
c
,
cc
,
html
in
special_chars
:
...
@@ -195,7 +195,7 @@ body { font-family: courier; font-size: 12; }
...
@@ -195,7 +195,7 @@ body { font-family: courier; font-size: 12; }
outlist
.
append
(
line
.
rstrip
())
outlist
.
append
(
line
.
rstrip
())
outlist
.
append
(
u'</pre>
\
n
'
)
outlist
.
append
(
u'</pre>
\
n
'
)
outlist
.
append
(
u"<pre id='line%s' class='code' style='background-color: #%s'>%s</pre>"
%
(
k
,
color
,
code
))
outlist
.
append
(
u"<pre id='line%s' class='c
ython c
ode' style='background-color: #%s'>%s</pre>"
%
(
k
,
color
,
code
))
return
outlist
return
outlist
_parse_code
=
re
.
compile
(
_parse_code
=
re
.
compile
(
...
@@ -226,7 +226,7 @@ class AnnotationItem(object):
...
@@ -226,7 +226,7 @@ class AnnotationItem(object):
self.size = size
self.size = size
def start(self):
def start(self):
return u"<span class='
tag
%
s
' title='
%
s
'>%s" % (self.style, self.text, self.tag)
return u"<span class='
cython
tag
%
s
' title='
%
s
'>%s" % (self.style, self.text, self.tag)
def end(self):
def end(self):
return self.size, u"</span>"
return self.size, u"</span>"
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