<s> from rapidsms . messages . base import MessageBase <EOL> from rapidsms . messages . error import ErrorMessage <EOL> class IncomingMessage ( MessageBase ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> if '<STR_LIT>' in kwargs : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> super ( IncomingMessage , self ) . __init__ ( * args , ** kwargs ) <EOL> self . responses = [ ] <EOL> @ property <EOL> def date ( self ) : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> def respond ( self , text , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if '<STR_LIT>' in kwargs : <EOL> raise TypeError ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> context = { '<STR_LIT:text>' : text , <EOL> '<STR_LIT>' : self . connections , <EOL> '<STR_LIT>' : self } <EOL> context . update ( kwargs ) <EOL> self . responses . append ( context ) <EOL> return context <EOL> def error ( self , text , ** kwargs ) : <EOL> return self . respond ( class_ = ErrorMessage , text = text , ** kwargs ) </s>
