[Cython] Install ck2cti.py and wrapper script

This commit is contained in:
Ray Speth 2013-06-21 20:58:15 +00:00
parent 39adabb820
commit 84aaec1417
6 changed files with 28 additions and 8 deletions

View file

@ -9,8 +9,11 @@ cantera/test/data/*.dat
cantera/test/data/*.csv
setup2.py
setup3.py
ctml_writer.py
cantera/ctml_writer.py
scripts/ctml_writer.py
scripts/ctml_writer
cantera/ck2cti.py
scripts/ck2cti.py
scripts/ck2cti
Cantera.egg-info
dist

View file

@ -43,19 +43,27 @@ def add_dependencies(mod, ext):
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')
# The actual ctml_writer script
build(env.Command('ctml_writer.py',
# The actual ctml_writer and ck2cti scripts
build(env.Command('cantera/ctml_writer.py',
'#interfaces/python/ctml_writer.py',
Copy('$TARGET', '$SOURCE')))
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')))
def install_module(prefix, python_version):
if prefix == 'USER':

View file

@ -0,0 +1,5 @@
#!/usr/bin/python
from cantera import ck2cti
import sys
ck2cti.main(sys.argv[1:])

View file

@ -1,5 +1,5 @@
#!/usr/bin/python
import ctml_writer
from cantera import ctml_writer
if __name__ == "__main__":
import sys

View file

@ -23,9 +23,9 @@ setup(name="Cantera",
'cantera.test',
'cantera.test.data',
'cantera.examples'],
scripts=[@py_ctml_writer@],
scripts=[@py_ctml_writer@,
@py_ck2cti@],
ext_modules = exts,
py_modules = ['ctml_writer'],
package_data = {'cantera.data': ['*.*'],
'cantera.test.data': ['*.*'],
'cantera.examples': ['*/*.*']})

View file

@ -1699,7 +1699,7 @@ duplicate transport data) to be ignored.
print('Mechanism contains {0} species and {1} reactions.'.format(len(self.speciesList), len(self.reactions)))
if __name__ == '__main__':
def main(argv):
import getopt
import sys
@ -1707,7 +1707,7 @@ if __name__ == '__main__':
'permissive', 'help', 'debug']
try:
optlist, args = getopt.getopt(sys.argv[1:], 'dh', longOptions)
optlist, args = getopt.getopt(argv, 'dh', longOptions)
options = dict()
for o,a in optlist:
options[o] = a
@ -1748,3 +1748,7 @@ if __name__ == '__main__':
parser.convertMech(inputFile, thermoFile, transportFile, phaseName,
outName, permissive=permissive)
if __name__ == '__main__':
import sys
main(sys.argv[1:])