<s> """<STR_LIT>""" <EOL> import logging <EOL> from pylons . controllers import WSGIController <EOL> from pylons . templating import render_mako as render <EOL> from pylons . controllers . util import redirect <EOL> from pylons import url <EOL> from pylons import app_globals as g <EOL> from pylons import session <EOL> log = logging . getLogger ( __name__ ) <EOL> class BaseController ( WSGIController ) : <EOL> requires_auth = False <EOL> def __before__ ( self ) : <EOL> self . m = None <EOL> if self . requires_auth and '<STR_LIT:user>' not in session and g . tc . webpassword != '<STR_LIT>' : <EOL> return redirect ( url ( controller = '<STR_LIT>' , action = '<STR_LIT>' ) ) <EOL> def __call__ ( self , environ , start_response ) : <EOL> """<STR_LIT>""" <EOL> return WSGIController . __call__ ( self , environ , start_response ) <EOL> def __after__ ( self ) : <EOL> log . debug ( '<STR_LIT>' ) <EOL> if self . m : <EOL> self . m . disconnect ( ) </s>
