Add __version__ attribute to (legacy) Python module

This commit is contained in:
Ray Speth 2013-06-13 22:50:40 +00:00
parent 496dfe31ce
commit e013e8b966
3 changed files with 7 additions and 4 deletions

View file

@ -15,6 +15,8 @@ from importFromFile import *
import os as _os
import sys as _sys
__version__ = _cantera.ct_get_version()
import warnings
warnings.warn(
"\nThis version of the Cantera Python module is deprecated and will not be\n"

View file

@ -101,7 +101,7 @@ ct_writelogfile(PyObject* self, PyObject* args)
return Py_BuildValue("i",iok);
}
static PyObject* ct_get_version(PyObject* self, PyObject* args)
{
return Py_BuildValue("s",std::string(CANTERA_VERSION).c_str());
}

View file

@ -91,6 +91,7 @@ static PyMethodDef ct_methods[] = {
{"ct_refcnt", ct_refcnt, METH_VARARGS},
{"ct_ck2cti", ct_ck2cti, METH_VARARGS},
{"ct_writelogfile", ct_writelogfile, METH_VARARGS},
{"ct_get_version", ct_get_version, METH_VARARGS},
//{"readlog", ct_readlog, METH_VARARGS},
//{"buildSolutionFromXML", ct_buildSolutionFromXML, METH_VARARGS},