""")
f.write(u'<body>\n')
f.write(u'<p>Generated by Cython %s on %s\n' % (Version.version, time.asctime()))
- c_file = Utils.encode_filename(os.path.basename(target_filename))
+ 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
def parse(self, source_desc, scope, pxd, full_module_name):
if not isinstance(source_desc, FileSourceDescriptor):
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
# Parse the given source file and return a parse tree.
try:
the position()-tuple.
"""
def __init__(self, filename):
+ filename = Utils.decode_filename(filename)
self.filename = filename
self.set_file_type_from_name(filename)
self._cmp_name = filename
pass
return False
-# support for source file encoding detection
+# file name encodings
-def encode_filename(filename):
+def decode_filename(filename):
if isinstance(filename, unicode):
return filename
try:
pass
return filename
+# support for source file encoding detection
+
_match_file_encoding = re.compile(u"coding[:=]\s*([-\w.]+)").search
def detect_file_encoding(source_filename):