Install ctml_writer with Cython module

This commit is contained in:
Ray Speth 2013-06-08 02:01:18 +00:00
parent 1cf8d9c8ea
commit 9e9fe849bc
4 changed files with 29 additions and 0 deletions

View file

@ -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

View file

@ -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':

View 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:])

View file

@ -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': ['*/*.*']})