diff options
Diffstat (limited to 'lib/base')
| -rw-r--r-- | lib/base/console.cpp | 13 | ||||
| -rw-r--r-- | lib/base/console.h | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/base/console.cpp b/lib/base/console.cpp index cc994ea9..a29772d8 100644 --- a/lib/base/console.cpp +++ b/lib/base/console.cpp @@ -333,7 +333,18 @@ void eConsoleAppContainer::write( const char *data, int len ) char *tmp = new char[len]; memcpy(tmp, data, len); outbuf.push(queue_data(tmp,len)); - out->start(); + if (out) + out->start(); +} + +void eConsoleAppContainer::write( PyObject *data ) +{ + char *buffer; + int length; + if (PyString_AsStringAndSize(data, &buffer, &length)) + return; + if (buffer && length) + write(buffer, length); } void eConsoleAppContainer::readyWrite(int what) diff --git a/lib/base/console.h b/lib/base/console.h index cf8e5397..07ad6a90 100644 --- a/lib/base/console.h +++ b/lib/base/console.h @@ -42,6 +42,7 @@ public: void kill(); void sendCtrlC(); void write( const char *data, int len ); + void write( PyObject *data ); bool running() { return (fd[0]!=-1) && (fd[1]!=-1) && (fd[2]!=-1); } PSignal1<void, const char*> dataAvail; PSignal1<void,int> dataSent; |
