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
42babb76
Commit
42babb76
authored
Nov 16, 2012
by
Dan Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementing module name parsing with os.path.
parent
f7cd93f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
bin/cython_freeze
bin/cython_freeze
+2
-8
No files found.
bin/cython_freeze
View file @
42babb76
...
...
@@ -7,6 +7,7 @@ See Demos/freeze/README.txt for more details.
"""
import
optparse
from
os.path
import
splitext
,
basename
usage
=
'%prog [-o outfile] [-p] module [module ...]'
description
=
'Create a C file for embedding Cython modules.'
...
...
@@ -27,14 +28,7 @@ if options.output:
old_stdout
=
sys
.
stdout
sys
.
stdout
=
open
(
options
.
output
,
'w'
)
def
format_modname
(
name
):
if
name
.
endswith
(
'.pyx'
):
name
=
name
[:
-
4
]
elif
name
.
endswith
(
'.py'
):
name
=
name
[:
-
3
]
return
name
.
replace
(
'.'
,
'_'
)
modules
=
[
format_modname
(
x
)
for
x
in
args
]
modules
=
[
basename
(
splitext
(
x
)[
0
]).
replace
(
'.'
,
'_'
)
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