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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
0c87bea0
Commit
0c87bea0
authored
Feb 24, 2011
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotate by default if there is an existing annotation.
parent
3d6647f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
Cython/Compiler/Annotate.py
Cython/Compiler/Annotate.py
+1
-0
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+10
-2
No files found.
Cython/Compiler/Annotate.py
View file @
0c87bea0
...
@@ -86,6 +86,7 @@ class AnnotationCCodeWriter(CCodeWriter):
...
@@ -86,6 +86,7 @@ class AnnotationCCodeWriter(CCodeWriter):
html_filename
=
os
.
path
.
splitext
(
target_filename
)[
0
]
+
".html"
html_filename
=
os
.
path
.
splitext
(
target_filename
)[
0
]
+
".html"
f
=
codecs
.
open
(
html_filename
,
"w"
,
encoding
=
"UTF-8"
)
f
=
codecs
.
open
(
html_filename
,
"w"
,
encoding
=
"UTF-8"
)
f
.
write
(
u'<!-- Generated by Cython %s on %s -->
\
n
'
%
(
Version
.
version
,
time
.
asctime
()))
f
.
write
(
u'<html>
\
n
'
)
f
.
write
(
u'<html>
\
n
'
)
f
.
write
(
u"""
f
.
write
(
u"""
<head>
<head>
...
...
Cython/Compiler/Main.py
View file @
0c87bea0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# Cython Top Level
# Cython Top Level
#
#
import
os
,
sys
,
re
import
os
,
sys
,
re
,
codecs
if
sys
.
version_info
[:
2
]
<
(
2
,
3
):
if
sys
.
version_info
[:
2
]
<
(
2
,
3
):
sys
.
stderr
.
write
(
"Sorry, Cython requires Python 2.3 or later
\
n
"
)
sys
.
stderr
.
write
(
"Sorry, Cython requires Python 2.3 or later
\
n
"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
@@ -607,6 +607,14 @@ def run_pipeline(source, options, full_module_name = None):
...
@@ -607,6 +607,14 @@ def run_pipeline(source, options, full_module_name = None):
# Set up result object
# Set up result object
result
=
create_default_resultobj
(
source
,
options
)
result
=
create_default_resultobj
(
source
,
options
)
if
options
.
annotate
is
None
:
# By default, decide based on whether an html file already exists.
html_filename
=
os
.
path
.
splitext
(
result
.
c_file
)[
0
]
+
".html"
if
os
.
path
.
exists
(
html_filename
):
line
=
codecs
.
open
(
html_filename
,
"r"
,
encoding
=
"UTF-8"
).
readline
()
if
line
.
startswith
(
u'<!-- Generated by Cython'
):
options
.
annotate
=
True
# Get pipeline
# Get pipeline
if
source_ext
.
lower
()
==
'.py'
:
if
source_ext
.
lower
()
==
'.py'
:
pipeline
=
context
.
create_py_pipeline
(
options
,
result
)
pipeline
=
context
.
create_py_pipeline
(
options
,
result
)
...
@@ -826,7 +834,7 @@ default_options = dict(
...
@@ -826,7 +834,7 @@ default_options = dict(
errors_to_stderr
=
1
,
errors_to_stderr
=
1
,
cplus
=
0
,
cplus
=
0
,
output_file
=
None
,
output_file
=
None
,
annotate
=
Fals
e
,
annotate
=
Non
e
,
generate_pxi
=
0
,
generate_pxi
=
0
,
working_path
=
""
,
working_path
=
""
,
recursive
=
0
,
recursive
=
0
,
...
...
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