Install ctml_writer with Cython module
This commit is contained in:
parent
1cf8d9c8ea
commit
9e9fe849bc
4 changed files with 29 additions and 0 deletions
3
interfaces/cython/.gitignore
vendored
3
interfaces/cython/.gitignore
vendored
|
|
@ -9,5 +9,8 @@ cantera/test/data/*.dat
|
|||
cantera/test/data/*.csv
|
||||
setup2.py
|
||||
setup3.py
|
||||
ctml_writer.py
|
||||
scripts/ctml_writer.py
|
||||
scripts/ctml_writer
|
||||
Cantera.egg-info
|
||||
dist
|
||||
|
|
|
|||
|
|
@ -40,6 +40,22 @@ def add_dependencies(mod, ext):
|
|||
mglob(localenv, 'cantera/examples/misc', 'py')):
|
||||
localenv.Depends(mod, f)
|
||||
|
||||
if os.name == 'nt':
|
||||
script_ext = '.py'
|
||||
localenv['py_ctml_writer'] = repr('scripts/ctml_writer.py')
|
||||
else:
|
||||
script_ext = ''
|
||||
localenv['py_ctml_writer'] = repr('scripts/ctml_writer')
|
||||
|
||||
# The actual ctml_writer script
|
||||
build(env.Command('ctml_writer.py',
|
||||
'#interfaces/python/ctml_writer.py',
|
||||
Copy('$TARGET', '$SOURCE')))
|
||||
|
||||
# thin wrapper
|
||||
build(env.Command('scripts/ctml_writer%s' % script_ext,
|
||||
'scripts/ctml_writer.py.in',
|
||||
Copy('$TARGET', '$SOURCE')))
|
||||
|
||||
def install_module(prefix, python_version):
|
||||
if prefix == 'USER':
|
||||
|
|
|
|||
8
interfaces/cython/scripts/ctml_writer.py.in
Normal file
8
interfaces/cython/scripts/ctml_writer.py.in
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/python
|
||||
import ctml_writer
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
if len(sys.argv) not in (2,3):
|
||||
raise ValueError('Incorrect number of command line arguments.')
|
||||
ctml_writer.convert(*sys.argv[1:])
|
||||
|
|
@ -23,7 +23,9 @@ setup(name="Cantera",
|
|||
'cantera.test',
|
||||
'cantera.test.data',
|
||||
'cantera.examples'],
|
||||
scripts=[@py_ctml_writer@],
|
||||
ext_modules = exts,
|
||||
py_modules = ['ctml_writer'],
|
||||
package_data = {'cantera.data': ['*.*'],
|
||||
'cantera.test.data': ['*.*'],
|
||||
'cantera.examples': ['*/*.*']})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue