<s> import json <EOL> from webmachine import Resource <EOL> from webmachine import wm <EOL> class Hello ( Resource ) : <EOL> def content_types_provided ( self , req , resp ) : <EOL> return ( <EOL> ( "<STR_LIT>" , self . to_html ) , <EOL> ( "<STR_LIT:application/json>" , self . to_json ) <EOL> ) <EOL> def to_html ( self , req , resp ) : <EOL> return "<STR_LIT>" <EOL> def to_json ( self , req , resp ) : <EOL> return "<STR_LIT>" % json . dumps ( { "<STR_LIT:message>" : "<STR_LIT>" , "<STR_LIT>" : True } ) <EOL> wm . add_resource ( Hello , r"<STR_LIT>" ) <EOL> wm . add_resource ( Hello ) </s>
