<s> class JSendMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def success ( self , data ) : <EOL> """<STR_LIT>""" <EOL> self . write ( { '<STR_LIT:status>' : '<STR_LIT:success>' , '<STR_LIT:data>' : data } ) <EOL> self . finish ( ) <EOL> def fail ( self , data ) : <EOL> """<STR_LIT>""" <EOL> self . write ( { '<STR_LIT:status>' : '<STR_LIT>' , '<STR_LIT:data>' : data } ) <EOL> self . finish ( ) <EOL> def error ( self , message , data = None , code = None ) : <EOL> """<STR_LIT>""" <EOL> result = { '<STR_LIT:status>' : '<STR_LIT:error>' , '<STR_LIT:message>' : message } <EOL> if data : <EOL> result [ '<STR_LIT:data>' ] = data <EOL> if code : <EOL> result [ '<STR_LIT:code>' ] = code <EOL> self . write ( result ) <EOL> self . finish ( ) </s>
