2 # $Id: DummyTransaction.py,v 1.13 2005/11/13 01:12:13 tavis_rudd Exp $
4 """Provides dummy Transaction and Response classes is used by Cheetah in place
5 of real Webware transactions when the Template obj is not used directly as a
10 Author: Tavis Rudd <tavis@damnsimple.com>
11 Version: $Revision: 1.13 $
12 Start Date: 2001/08/30
13 Last Revision Date: $Date: 2005/11/13 01:12:13 $
15 __author__
= "Tavis Rudd <tavis@damnsimple.com>"
16 __revision__
= "$Revision: 1.13 $"[11:-2]
23 """A dummy Response class is used by Cheetah in place of real Webware
24 Response objects when the Template obj is not used directly as a Webware
29 self
._outputChunks
= outputChunks
= []
30 self
.write
= write
= outputChunks
.append
31 def getvalue(outputChunks
=outputChunks
):
32 return ''.join(outputChunks
)
33 self
.getvalue
= getvalue
38 self
.writeln
= writeln
41 def writelines(self
, *lines
):
43 [self
.writeln(ln
) for ln
in lines
]
45 class DummyTransaction
:
47 """A dummy Transaction class is used by Cheetah in place of real Webware
48 transactions when the Template obj is not used directly as a Webware
51 It only provides a response object and method. All other methods and
52 attributes make no sense in this context.
55 def __init__(self
, DummyResponse
=DummyResponse
):
56 def response(resp
=DummyResponse()):
58 self
.response
= response