<s> """<STR_LIT>""" <EOL> from zope . interface import implements <EOL> from twisted . internet . defer import succeed <EOL> from twisted . web . iweb import IBodyProducer <EOL> class StringProducer ( object ) : <EOL> """<STR_LIT>""" <EOL> implements ( IBodyProducer ) <EOL> def __init__ ( self , body ) : <EOL> """<STR_LIT>""" <EOL> self . body = body <EOL> self . length = len ( body ) <EOL> def startProducing ( self , consumer ) : <EOL> consumer . write ( self . body ) <EOL> return succeed ( None ) <EOL> def pauseProducing ( self ) : <EOL> pass <EOL> def stopProducing ( self ) : <EOL> pass </s>
