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
Boxiang Sun
cython
Commits
336ca7b1
Commit
336ca7b1
authored
Dec 15, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code reformatting.
parent
58e75071
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+18
-9
No files found.
Cython/Compiler/Main.py
View file @
336ca7b1
...
...
@@ -18,12 +18,12 @@ try:
except
ImportError
:
basestring
=
str
from
.
import
Errors
# Do not import Parsing here, import it when needed, because Parsing imports
# Nodes, which globally needs debug command line options initialized to set a
# conditional metaclass. These options are processed by CmdLine called from
# main() in this file.
# import Parsing
from
.
import
Errors
from
.StringEncoding
import
EncodedString
from
.Scanning
import
PyrexScanner
,
FileSourceDescriptor
from
.Errors
import
PyrexError
,
CompileError
,
error
,
warning
...
...
@@ -38,6 +38,7 @@ module_name_pattern = re.compile(r"[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_
verbose
=
0
class
CompilationData
(
object
):
# Bundles the information that is passed from transform to transform.
# (For now, this is only)
...
...
@@ -52,6 +53,7 @@ class CompilationData(object):
# result CompilationResult
pass
class
Context
(
object
):
# This class encapsulates the context needed for compiling
# one or more Cython implementation files along with their
...
...
@@ -426,6 +428,7 @@ class Context(object):
pass
result
.
c_file
=
None
def
get_output_filename
(
source_filename
,
cwd
,
options
):
if
options
.
cplus
:
c_suffix
=
".cpp"
...
...
@@ -441,6 +444,7 @@ def get_output_filename(source_filename, cwd, options):
else
:
return
suggested_file_name
def
create_default_resultobj
(
compilation_source
,
options
):
result
=
CompilationResult
()
result
.
main_source_file
=
compilation_source
.
source_desc
.
filename
...
...
@@ -451,6 +455,7 @@ def create_default_resultobj(compilation_source, options):
result
.
embedded_metadata
=
options
.
embedded_metadata
return
result
def
run_pipeline
(
source
,
options
,
full_module_name
=
None
,
context
=
None
):
from
.
import
Pipeline
...
...
@@ -496,11 +501,11 @@ def run_pipeline(source, options, full_module_name=None, context=None):
return
result
#------------------------------------------------------------------------
#
------------------------------------------------------------------------
#
# Main Python entry points
#
#------------------------------------------------------------------------
#
------------------------------------------------------------------------
class
CompilationSource
(
object
):
"""
...
...
@@ -512,6 +517,7 @@ class CompilationSource(object):
self
.
full_module_name
=
full_module_name
self
.
cwd
=
cwd
class
CompilationOptions
(
object
):
"""
Options to the Cython compiler:
...
...
@@ -678,6 +684,7 @@ def compile_multiple(sources, options):
processed
.
add
(
source
)
return
results
def
compile
(
source
,
options
=
None
,
full_module_name
=
None
,
**
kwds
):
"""
compile(source [, options], [, <option> = <value>]...)
...
...
@@ -694,14 +701,17 @@ def compile(source, options = None, full_module_name = None, **kwds):
else
:
return
compile_multiple
(
source
,
options
)
#------------------------------------------------------------------------
# ------------------------------------------------------------------------
#
# Main command-line entry point
#
#------------------------------------------------------------------------
# ------------------------------------------------------------------------
def
setuptools_main
():
return
main
(
command_line
=
1
)
def
main
(
command_line
=
0
):
args
=
sys
.
argv
[
1
:]
any_failures
=
0
...
...
@@ -727,12 +737,11 @@ def main(command_line = 0):
sys
.
exit
(
1
)
#------------------------------------------------------------------------
# ------------------------------------------------------------------------
#
# Set the default options depending on the platform
#
#------------------------------------------------------------------------
#
------------------------------------------------------------------------
default_options
=
dict
(
show_version
=
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