[SCons] Install script for running MixMaster with new Python module

This commit is contained in:
Ray Speth 2013-06-21 20:59:00 +00:00
parent 70178cee04
commit 4591159cd9
4 changed files with 17 additions and 16 deletions

View file

@ -15,5 +15,7 @@ scripts/ctml_writer
cantera/ck2cti.py
scripts/ck2cti.py
scripts/ck2cti
scripts/mixmaster
scripts/mixmaster.py
Cantera.egg-info
dist

View file

@ -42,14 +42,10 @@ 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')
localenv['py_ck2cti'] = repr('scripts/ck2cti.py')
else:
script_ext = ''
localenv['py_ctml_writer'] = repr('scripts/ctml_writer')
localenv['py_ck2cti'] = repr('scripts/ck2cti')
script_ext = '.py' if os.name == 'nt' else ''
localenv['py_ctml_writer'] = repr('scripts/ctml_writer%s' % script_ext)
localenv['py_ck2cti'] = repr('scripts/ck2cti%s' % script_ext)
localenv['py_mixmaster'] = repr('scripts/mixmaster%s' % script_ext)
# The actual ctml_writer and ck2cti scripts
build(env.Command('cantera/ctml_writer.py',
@ -59,13 +55,11 @@ build(env.Command('cantera/ck2cti.py',
'#interfaces/python/ck2cti.py',
Copy('$TARGET', '$SOURCE')))
# thin wrapper
build(env.Command('scripts/ctml_writer%s' % script_ext,
'scripts/ctml_writer.py.in',
Copy('$TARGET', '$SOURCE')))
build(env.Command('scripts/ck2cti%s' % script_ext,
'scripts/ck2cti.py.in',
Copy('$TARGET', '$SOURCE')))
# thin wrappers
for script in mglob(env, 'scripts', 'py.in'):
base_name = script.name.split('.')[0]
build(env.Command('scripts/%s%s' % (base_name, script_ext), script,
Copy('$TARGET', '$SOURCE')))
def install_module(prefix, python_version):
if prefix == 'USER':

View file

@ -0,0 +1,4 @@
#!/usr/bin/python
from cantera.mixmaster.main import MixMaster
MixMaster()

View file

@ -26,7 +26,8 @@ setup(name="Cantera",
'cantera.mixmaster.Units',
'cantera.examples'],
scripts=[@py_ctml_writer@,
@py_ck2cti@],
@py_ck2cti@,
@py_mixmaster@],
ext_modules = exts,
package_data = {'cantera.data': ['*.*'],
'cantera.test.data': ['*.*'],