Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1061)

Unified Diff: third_party/twisted_8_1/twisted/flow/web.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/flow/web.py
diff --git a/third_party/twisted_8_1/twisted/flow/web.py b/third_party/twisted_8_1/twisted/flow/web.py
deleted file mode 100644
index d009cba99da6cac5aba0a74b03ddd084b967a828..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/flow/web.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-#
-# Author: Clark Evans (cce@clarkevans.com)
-
-""" flow.web
-
- This contains wrappers to apply flow to components in twisted.web.*
-
-"""
-from controller import Deferred
-from twisted.web import resource, server
-from twisted.python.failure import Failure
-
-class Resource(resource.Resource):
- """
- A resource which uses flow in its page generation.
-
- Use it like this::
-
- from __future__ import generators
- from twisted.flow import flow
-
- def render(req):
- req.write("<html><head><title>Delayed</title></head>")
- req.write("<body><h1>Delayed WebPage</h1>")
- yield flow.Cooperate(5)
- req.write("<p>Delayed Content</p></body></html>")
-
- if __name__=='__main__':
- from twisted.internet import reactor
- from twisted.web.server import Site
- from twisted.flow.web import Resource
- print "visit http://localhost:8081/ to view"
- reactor.listenTCP(8081,Site(Resource(render)))
- reactor.run()
- """
- def __init__(self, gen):
- resource.Resource.__init__(self)
- self.gen = gen
-
- def isLeaf(self):
- return true
-
- def render(self, req):
- self.d = Deferred(self.gen(req))
- self.d.addErrback(lambda fail: fail.printTraceback())
- self.d.addBoth(lambda ret: req.finish() or ret)
- return server.NOT_DONE_YET
« no previous file with comments | « third_party/twisted_8_1/twisted/flow/topfiles/setup.py ('k') | third_party/twisted_8_1/twisted/flow/wrap.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698