<s> import logging <EOL> from shakespeare . lib . base import * <EOL> import shakespeare <EOL> import shakespeare . format <EOL> import shakespeare . model as model <EOL> log = logging . getLogger ( __name__ ) <EOL> class TextController ( BaseController ) : <EOL> def index ( self ) : <EOL> c . works_index = model . Material . query . all ( ) <EOL> return render ( '<STR_LIT>' ) <EOL> def info ( self , id ) : <EOL> name = id <EOL> c . material = model . Material . by_name ( name ) <EOL> if c . material : <EOL> return render ( '<STR_LIT>' ) <EOL> else : <EOL> abort ( <NUM_LIT> ) <EOL> def view ( self , id = '<STR_LIT>' ) : <EOL> name = id <EOL> m = model . Material . by_name ( name ) <EOL> if not m : <EOL> abort ( <NUM_LIT> ) <EOL> if m . resources : <EOL> h . redirect_to ( controller = '<STR_LIT>' , action = '<STR_LIT>' , <EOL> id = m . resources [ <NUM_LIT:0> ] . id ) <EOL> else : <EOL> return '<STR_LIT>' </s>
