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
986559fb
Commit
986559fb
authored
Oct 04, 2009
by
Mark Lodato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freeze: use optparse to parse arguments
parent
e1a8c058
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
bin/cython_freeze
bin/cython_freeze
+11
-5
No files found.
bin/cython_freeze
View file @
986559fb
...
...
@@ -6,11 +6,17 @@ Requires Cython 0.11.2 (or perhaps newer).
See Demos/freeze/README.rst for more details.
"""
import
sys
import
optparse
if
len
(
sys
.
argv
)
<
2
:
print
>>
sys
.
stderr
,
"USAGE: %s module [module ...]"
%
sys
.
argv
[
0
]
sys
.
exit
(
1
)
usage
=
'%prog module [module ...]'
description
=
'Create a C file for embedding Cython modules.'
p
=
optparse
.
OptionParser
(
usage
=
usage
,
description
=
description
)
options
,
args
=
p
.
parse_args
()
if
len
(
args
)
<
1
:
p
.
print_help
()
p
.
exit
(
1
)
def
format_modname
(
name
):
if
name
.
endswith
(
'.pyx'
):
...
...
@@ -19,7 +25,7 @@ def format_modname(name):
name
=
name
[:
-
3
]
return
name
.
replace
(
'.'
,
'_'
)
modules
=
[
format_modname
(
x
)
for
x
in
sys
.
argv
[
1
:]
]
modules
=
[
format_modname
(
x
)
for
x
in
args
]
print
"""
#include <Python.h>
...
...
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