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
9ebc3650
Commit
9ebc3650
authored
Aug 14, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'profile_abspath' of github.com:martinra/cython into martinra-profile_abspath
parents
ade9b4e7
e3b1cc75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+12
-1
No files found.
Cython/Compiler/ModuleNode.py
View file @
9ebc3650
...
@@ -683,11 +683,22 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -683,11 +683,22 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln_openmp
(
"#include <omp.h>"
)
code
.
putln_openmp
(
"#include <omp.h>"
)
def
generate_filename_table
(
self
,
code
):
def
generate_filename_table
(
self
,
code
):
import
os.path
as
path
full_module_path
=
path
.
join
(
*
self
.
full_module_name
.
split
(
'.'
))
module_abspath
=
path
.
splitext
(
path
.
abspath
(
self
.
compilation_source
.
source_desc
.
get_filenametable_entry
()
))[
0
]
module_relpath
=
module_abspath
[:
-
len
(
full_module_path
)]
code
.
putln
(
""
)
code
.
putln
(
""
)
code
.
putln
(
"static const char *%s[] = {"
%
Naming
.
filetable_cname
)
code
.
putln
(
"static const char *%s[] = {"
%
Naming
.
filetable_cname
)
if
code
.
globalstate
.
filename_list
:
if
code
.
globalstate
.
filename_list
:
for
source_desc
in
code
.
globalstate
.
filename_list
:
for
source_desc
in
code
.
globalstate
.
filename_list
:
filename
=
os
.
path
.
basename
(
source_desc
.
get_filenametable_entry
())
file_abspath
=
path
.
abspath
(
source_desc
.
get_filenametable_entry
())
if
file_abspath
.
startswith
(
module_relpath
):
filename
=
file_abspath
[
len
(
module_relpath
):]
else
:
filename
=
path
.
basename
(
file_abspath
)
escaped_filename
=
filename
.
replace
(
"
\
\
"
,
"
\
\
\
\
"
).
replace
(
'"'
,
r'\"'
)
escaped_filename
=
filename
.
replace
(
"
\
\
"
,
"
\
\
\
\
"
).
replace
(
'"'
,
r'\"'
)
code
.
putln
(
'"%s",'
%
escaped_filename
)
code
.
putln
(
'"%s",'
%
escaped_filename
)
else
:
else
:
...
...
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