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
ce8776b3
Commit
ce8776b3
authored
Aug 21, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow deterministic "generated by" string for easy comparison.
parent
cc452cb6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
Cython/Compiler/Annotate.py
Cython/Compiler/Annotate.py
+2
-2
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-2
Cython/Compiler/Version.py
Cython/Compiler/Version.py
+5
-0
runtests.py
runtests.py
+6
-0
No files found.
Cython/Compiler/Annotate.py
View file @
ce8776b3
...
...
@@ -86,7 +86,7 @@ class AnnotationCCodeWriter(CCodeWriter):
html_filename
=
os
.
path
.
splitext
(
target_filename
)[
0
]
+
".html"
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'<!-- Generated by Cython %s
-->
\
n
'
%
Version
.
watermark
)
f
.
write
(
u'<html>
\
n
'
)
f
.
write
(
u"""
<head>
...
...
@@ -127,7 +127,7 @@ function toggleDiv(id) {
</head>
"""
)
f
.
write
(
u'<body>
\
n
'
)
f
.
write
(
u'<p>Generated by Cython %s
on %s
\
n
'
%
(
Version
.
version
,
time
.
asctime
())
)
f
.
write
(
u'<p>Generated by Cython %s
\
n
'
%
Version
.
watermark
)
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
))
k
=
0
...
...
Cython/Compiler/ModuleNode.py
View file @
ce8776b3
...
...
@@ -27,6 +27,7 @@ from Code import UtilityCode
from
StringEncoding
import
EncodedString
def
check_c_declarations_pxd
(
module_node
):
module_node
.
scope
.
check_c_classes_pxd
()
return
module_node
...
...
@@ -491,8 +492,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
generate_cfunction_declarations
(
module
,
modulecode
,
defined_here
)
def
generate_module_preamble
(
self
,
env
,
cimported_modules
,
code
):
code
.
putln
(
"/* Generated by Cython %s on %s */"
%
(
Version
.
version
,
time
.
asctime
()))
code
.
putln
(
"/* Generated by Cython %s */"
%
Version
.
watermark
)
code
.
putln
(
""
)
code
.
putln
(
"#define PY_SSIZE_T_CLEAN"
)
for
filename
in
env
.
python_include_files
:
...
...
Cython/Compiler/Version.py
View file @
ce8776b3
# for backwards compatibility
from
Cython
import
__version__
as
version
# For generated by string.
import
time
watermark
=
"%s on %s"
%
(
version
,
time
.
asctime
())
runtests.py
View file @
ce8776b3
...
...
@@ -1443,6 +1443,8 @@ def main():
help="configure for easier use with a debugger (e.g. gdb)")
parser.add_option("--pyximport-py", dest="pyximport_py", default=False, action="store_true",
help="use pyximport to automatically compile imported .pyx and .py files")
parser.add_option("--watermark", dest="watermark", default=None,
help="deterministic generated by string")
options, cmd_args = parser.parse_args()
...
...
@@ -1472,6 +1474,10 @@ def main():
else
:
options
.
with_cython
=
False
if
options
.
watermark
:
import
Cython.Compiler.Version
Cython
.
Compiler
.
Version
.
watermark
=
options
.
watermark
WITH_CYTHON
=
options
.
with_cython
coverage
=
None
...
...
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