diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-02-13 17:45:05 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-02-13 17:45:05 +0000 |
| commit | 49052eeadcd62b9fda6be660c490d04577b6eabe (patch) | |
| tree | b62378ed7ea72840a9a1a81a15834fc5e060d0e8 /lib | |
| parent | 56f5fa20371cd5a761dc37a6dd0dd730c38e0cbc (diff) | |
| download | enigma2-49052eeadcd62b9fda6be660c490d04577b6eabe.tar.gz enigma2-49052eeadcd62b9fda6be660c490d04577b6eabe.zip | |
pipe python stdout trough enigma
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/base/eerror.cpp | 12 | ||||
| -rw-r--r-- | lib/base/eerror.h | 3 | ||||
| -rw-r--r-- | lib/python/Tools/Makefile.am | 4 | ||||
| -rw-r--r-- | lib/python/Tools/RedirectOutput.py | 11 | ||||
| -rw-r--r-- | lib/python/Tools/__init__.py | 3 |
5 files changed, 31 insertions, 2 deletions
diff --git a/lib/base/eerror.cpp b/lib/base/eerror.cpp index c60d5b7b..3239ddc5 100644 --- a/lib/base/eerror.cpp +++ b/lib/base/eerror.cpp @@ -80,3 +80,15 @@ void eWarning(const char* fmt, ...) fprintf(stderr, "%s\n", buf); } #endif // DEBUG + +void ePythonOutput(const char *string) +{ + logOutput(lvlWarning, string); + if (logOutputConsole) + fwrite(string, 1, strlen(string), stderr); +} + +void eWriteCrashdump() +{ + /* implement me */ +} diff --git a/lib/base/eerror.h b/lib/base/eerror.h index 91575878..36e43388 100644 --- a/lib/base/eerror.h +++ b/lib/base/eerror.h @@ -207,4 +207,7 @@ inline void DumpUnfreed() #define ASSERT(x) do { } while (0) #endif //DEBUG +void ePythonOutput(const char *); +void eWriteCrashdump(); + #endif // __E_ERROR__ diff --git a/lib/python/Tools/Makefile.am b/lib/python/Tools/Makefile.am index bee4dde1..f1fc9368 100644 --- a/lib/python/Tools/Makefile.am +++ b/lib/python/Tools/Makefile.am @@ -1,4 +1,6 @@ installdir = $(LIBDIR)/enigma2/python/Tools install_DATA = \ - FuzzyDate.py XMLTools.py Directories.py NumericalTextInput.py KeyBindings.py BoundFunction.py ISO639.py Notifications.py __init__.py + FuzzyDate.py XMLTools.py Directories.py NumericalTextInput.py \ + KeyBindings.py BoundFunction.py ISO639.py Notifications.py __init__.py \ + RedirectOutput.py diff --git a/lib/python/Tools/RedirectOutput.py b/lib/python/Tools/RedirectOutput.py new file mode 100644 index 00000000..83cb5f8c --- /dev/null +++ b/lib/python/Tools/RedirectOutput.py @@ -0,0 +1,11 @@ +import sys +from enigma import ePythonOutput + +class EnigmaOutput: + def write(self, data): + ePythonOutput(data) + + def flush(): + pass + +sys.stdout = sys.stderr = EnigmaOutput() diff --git a/lib/python/Tools/__init__.py b/lib/python/Tools/__init__.py index df963dad..16205a55 100644 --- a/lib/python/Tools/__init__.py +++ b/lib/python/Tools/__init__.py @@ -1 +1,2 @@ -all = ["FuzzyDate.py", "XMLTools.py", "Directories.py", "KeyBindings.py", "BoundFunction.py", "ISO639.py", "Notifications"] +all = ["FuzzyDate.py", "XMLTools.py", "Directories.py", "KeyBindings.py", "BoundFunction.py", "ISO639.py", "Notifications", + "RedirectOutput.py"] |
