summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2008-04-27 06:26:24 +0000
committerianb <devnull@localhost>2008-04-27 06:26:24 +0000
commit6899dbab4003886a5ed0eff27667ed2ffd7663e7 (patch)
tree86c8a2d0e925ee699ae59c33523351af6d9dd891
parentae342f3ec36faed8dd35f858e9cf342d45a9d864 (diff)
downloadpaste-6899dbab4003886a5ed0eff27667ed2ffd7663e7.tar.gz
Add some more methods to the threaded replacement for stdout (for appengine)
-rw-r--r--docs/news.txt2
-rw-r--r--paste/util/threadedprint.py18
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)