mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
build 190929. jointctrl cab control animation tweak, vehicle attachment support fixes, axle clatter fix, python module error logging fix
This commit is contained in:
11
PyInt.cpp
11
PyInt.cpp
@@ -192,8 +192,7 @@ auto python_taskqueue::run_file( std::string const &File, std::string const &Pat
|
||||
if( lookup.first.empty() ) { return false; }
|
||||
|
||||
std::ifstream inputfile { lookup.first + lookup.second };
|
||||
std::string input;
|
||||
input.assign( std::istreambuf_iterator<char>( inputfile ), std::istreambuf_iterator<char>() );
|
||||
std::string const input { std::istreambuf_iterator<char>( inputfile ), std::istreambuf_iterator<char>() };
|
||||
|
||||
if( PyRun_SimpleString( input.c_str() ) != 0 ) {
|
||||
error();
|
||||
@@ -215,7 +214,7 @@ void python_taskqueue::release_lock() {
|
||||
PyEval_SaveThread();
|
||||
}
|
||||
|
||||
auto python_taskqueue::fetch_renderer( std::string const Renderer ) ->PyObject * {
|
||||
auto python_taskqueue::fetch_renderer( std::string const Renderer ) -> PyObject * {
|
||||
|
||||
auto const lookup { m_renderers.find( Renderer ) };
|
||||
if( lookup != std::end( m_renderers ) ) {
|
||||
@@ -296,7 +295,9 @@ void python_taskqueue::run( GLFWwindow *Context, rendertask_sequence &Tasks, thr
|
||||
{
|
||||
// execute python code
|
||||
task->run();
|
||||
error();
|
||||
if( PyErr_Occurred() != nullptr ) {
|
||||
error();
|
||||
}
|
||||
}
|
||||
// clear the thread state
|
||||
PyEval_SaveThread();
|
||||
@@ -318,8 +319,6 @@ void python_taskqueue::run( GLFWwindow *Context, rendertask_sequence &Tasks, thr
|
||||
void
|
||||
python_taskqueue::error() {
|
||||
|
||||
if( PyErr_Occurred() == nullptr ) { return; }
|
||||
|
||||
if( m_stderr != nullptr ) {
|
||||
// std err pythona jest buforowane
|
||||
PyErr_Print();
|
||||
|
||||
Reference in New Issue
Block a user