diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2008-04-13 22:40:38 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2008-04-13 22:40:38 +0000 |
| commit | 1c4d458b5df83facce7cf71b39ab247eb1447491 (patch) | |
| tree | 584a44a8398d97396ff42f1c0ed97c82ec9a611d /lib/base/console.cpp | |
| parent | 46b16b46aa3c50fdc848f3c228d06871450653f2 (diff) | |
| download | enigma2-1c4d458b5df83facce7cf71b39ab247eb1447491.tar.gz enigma2-1c4d458b5df83facce7cf71b39ab247eb1447491.zip | |
add support for writing python strings directly
Diffstat (limited to 'lib/base/console.cpp')
| -rw-r--r-- | lib/base/console.cpp | 13 |
1 files changed, 12 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) |
