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
bcfa729f
Commit
bcfa729f
authored
Jun 30, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always use decoded filenames in FileSourceDescriptor
parent
96b2e5a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
Cython/Compiler/Annotate.py
Cython/Compiler/Annotate.py
+1
-1
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+1
-1
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+1
-0
Cython/Utils.py
Cython/Utils.py
+4
-2
No files found.
Cython/Compiler/Annotate.py
View file @
bcfa729f
...
@@ -127,7 +127,7 @@ function toggleDiv(id) {
...
@@ -127,7 +127,7 @@ function toggleDiv(id) {
"""
)
"""
)
f
.
write
(
u'<body>
\
n
'
)
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 on %s
\
n
'
%
(
Version
.
version
,
time
.
asctime
()))
c_file
=
Utils
.
en
code_filename
(
os
.
path
.
basename
(
target_filename
))
c_file
=
Utils
.
de
code_filename
(
os
.
path
.
basename
(
target_filename
))
f
.
write
(
u'<p>Raw output: <a href="%s">%s</a>
\
n
'
%
(
c_file
,
c_file
))
f
.
write
(
u'<p>Raw output: <a href="%s">%s</a>
\
n
'
%
(
c_file
,
c_file
))
k
=
0
k
=
0
...
...
Cython/Compiler/Main.py
View file @
bcfa729f
...
@@ -479,7 +479,7 @@ class Context(object):
...
@@ -479,7 +479,7 @@ class Context(object):
def
parse
(
self
,
source_desc
,
scope
,
pxd
,
full_module_name
):
def
parse
(
self
,
source_desc
,
scope
,
pxd
,
full_module_name
):
if
not
isinstance
(
source_desc
,
FileSourceDescriptor
):
if
not
isinstance
(
source_desc
,
FileSourceDescriptor
):
raise
RuntimeError
(
"Only file sources for code supported"
)
raise
RuntimeError
(
"Only file sources for code supported"
)
source_filename
=
Utils
.
encode_filename
(
source_desc
.
filename
)
source_filename
=
source_desc
.
filename
scope
.
cpp
=
self
.
cpp
scope
.
cpp
=
self
.
cpp
# Parse the given source file and return a parse tree.
# Parse the given source file and return a parse tree.
try
:
try
:
...
...
Cython/Compiler/Scanning.py
View file @
bcfa729f
...
@@ -166,6 +166,7 @@ class FileSourceDescriptor(SourceDescriptor):
...
@@ -166,6 +166,7 @@ class FileSourceDescriptor(SourceDescriptor):
the position()-tuple.
the position()-tuple.
"""
"""
def
__init__
(
self
,
filename
):
def
__init__
(
self
,
filename
):
filename
=
Utils
.
decode_filename
(
filename
)
self
.
filename
=
filename
self
.
filename
=
filename
self
.
set_file_type_from_name
(
filename
)
self
.
set_file_type_from_name
(
filename
)
self
.
_cmp_name
=
filename
self
.
_cmp_name
=
filename
...
...
Cython/Utils.py
View file @
bcfa729f
...
@@ -66,9 +66,9 @@ def path_exists(path):
...
@@ -66,9 +66,9 @@ def path_exists(path):
pass
pass
return
False
return
False
#
support for source file encoding detection
#
file name encodings
def
en
code_filename
(
filename
):
def
de
code_filename
(
filename
):
if
isinstance
(
filename
,
unicode
):
if
isinstance
(
filename
,
unicode
):
return
filename
return
filename
try
:
try
:
...
@@ -80,6 +80,8 @@ def encode_filename(filename):
...
@@ -80,6 +80,8 @@ def encode_filename(filename):
pass
pass
return
filename
return
filename
# support for source file encoding detection
_match_file_encoding
=
re
.
compile
(
u"coding[:=]
\
s*([-
\
w.]+)"
).
search
_match_file_encoding
=
re
.
compile
(
u"coding[:=]
\
s*([-
\
w.]+)"
).
search
def
detect_file_encoding
(
source_filename
):
def
detect_file_encoding
(
source_filename
):
...
...
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