mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
* client/Py_CreatorClient.h, rulesets/Py_BBox.h,
rulesets/Py_Location.h, rulesets/Py_Map.h, rulesets/Py_Mind.h, rulesets/Py_Object.h, rulesets/Py_Operation.h, rulesets/Py_Oplist.h, rulesets/Py_Point3D.h, rulesets/Py_Quaternion.h, rulesets/Py_RootEntity.h, rulesets/Py_Task.h, rulesets/Py_Thing.h, rulesets/Py_Vector3D.h, rulesets/Py_World.h, rulesets/Py_WorldTime.h: Re-wrote PyFoo_Check macros to comply with recent conventions and be a little more efficient. * rulesets/Py_Statistics.cpp, rulesets/PythonArithmeticScript.cpp, rulesets/mason/world/statistics/Statistics.py: Remove lots of debug output. * rulesets/PythonArithmeticScript.h: Add an accessor to get to the python object. * rulesets/StatisticsProperty.h: Add an accessor to get to the Statistics reference handled by this class. * rulesets/Py_Property.cpp: Return the script for a statistics object rather than creating a wrapper for it.
This commit is contained in:
parent
5787081fb7
commit
692aeda5af
23 changed files with 64 additions and 32 deletions
|
|
@ -21,14 +21,12 @@ PythonArithmeticScript::~PythonArithmeticScript()
|
|||
|
||||
int PythonArithmeticScript::attribute(const std::string & name, float & val)
|
||||
{
|
||||
std::cout << "Request for attribute " << name << " from python script"
|
||||
<< std::endl << std::flush;
|
||||
PyObject * py_name = PyString_FromString(name.c_str());
|
||||
PyObject * ret = PyObject_CallMethod(m_script, "attribute", "(O)", py_name);
|
||||
Py_DECREF(py_name);
|
||||
if (ret == NULL) {
|
||||
if (PyErr_Occurred() == NULL) {
|
||||
std::cout << "No attribute method" << std::endl << std::flush;
|
||||
// std::cout << "No attribute method" << std::endl << std::flush;
|
||||
} else {
|
||||
log(ERROR, "Reporting python error");
|
||||
PyErr_Print();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue