2006-01-08 05:26:58 +00:00
|
|
|
// This file may be redistributed and modified only under the terms of
|
|
|
|
|
// the GNU General Public License (See COPYING for details).
|
|
|
|
|
// Copyright (C) 2005 Alistair Riddoch
|
|
|
|
|
|
|
|
|
|
#include <Python.h>
|
2006-01-10 17:51:32 +00:00
|
|
|
|
2006-01-08 05:26:58 +00:00
|
|
|
#include "PythonArithmeticScript.h"
|
|
|
|
|
|
2006-01-10 17:51:32 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
2006-01-08 05:26:58 +00:00
|
|
|
PythonArithmeticScript::PythonArithmeticScript(PyObject * o) : m_script(o)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PythonArithmeticScript::~PythonArithmeticScript()
|
|
|
|
|
{
|
|
|
|
|
Py_DECREF(m_script);
|
|
|
|
|
}
|
2006-01-10 17:51:32 +00:00
|
|
|
|
|
|
|
|
int PythonArithmeticScript::attribute(const std::string & name, float & val)
|
|
|
|
|
{
|
|
|
|
|
std::cout << "Request for attribute " << name << " from python script"
|
|
|
|
|
<< std::endl << std::flush;
|
|
|
|
|
val = 0.5f;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|