<s> from rapidsms . contrib . handlers import KeywordHandler , PatternHandler <EOL> class EchoKeywordHandler ( KeywordHandler ) : <EOL> """<STR_LIT>""" <EOL> keyword = '<STR_LIT:hello>' <EOL> HELP_TEXT = '<STR_LIT>' <EOL> def help ( self ) : <EOL> self . respond ( self . HELP_TEXT ) <EOL> def handle ( self , text ) : <EOL> self . respond ( text ) <EOL> class AdditionPatternHandler ( PatternHandler ) : <EOL> """<STR_LIT>""" <EOL> pattern = r'<STR_LIT>' <EOL> def handle ( self , a , b ) : <EOL> a , b = int ( a ) , int ( b ) <EOL> total = a + b <EOL> self . respond ( '<STR_LIT>' % ( a , b , total ) ) </s>
