diff options
author | ianb <devnull@localhost> | 2008-04-27 06:26:24 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2008-04-27 06:26:24 +0000 |
commit | 6899dbab4003886a5ed0eff27667ed2ffd7663e7 (patch) | |
tree | 86c8a2d0e925ee699ae59c33523351af6d9dd891 | |
parent | ae342f3ec36faed8dd35f858e9cf342d45a9d864 (diff) | |
download | paste-6899dbab4003886a5ed0eff27667ed2ffd7663e7.tar.gz |
Add some more methods to the threaded replacement for stdout (for appengine)
-rw-r--r-- | docs/news.txt | 2 | ||||
-rw-r--r-- | paste/util/threadedprint.py | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/docs/news.txt b/docs/news.txt index 931ac30..0543556 100644 --- a/docs/news.txt +++ b/docs/news.txt @@ -52,6 +52,8 @@ svn trunk * Use ``environ['wsgi.file_wrapper']`` when available (in ``paste.fileapp``). +* Make ``paste.debug.prints` compatible with App Engine. + 1.6.1 ----- diff --git a/paste/util/threadedprint.py b/paste/util/threadedprint.py index 0cdcdd6..c95d3a1 100644 --- a/paste/util/threadedprint.py +++ b/paste/util/threadedprint.py @@ -98,6 +98,24 @@ class PrintCatcher(filemixin.FileMixin): catcher = catchers[name] catcher.write(v) + def seek(self, *args): + # Weird, but Google App Engine is seeking on stdout + name = threading.currentThread().getName() + catchers = self._catchers + if not name in catchers: + self._default.seek(*args) + else: + catchers[name].seek(*args) + + def read(self, *args): + name = threading.currentThread().getName() + catchers = self._catchers + if not name in catchers: + self._default.read(*args) + else: + catchers[name].read(*args) + + def _writedefault(self, name, v): self._default.write(v) |