<s> """<STR_LIT>""" <EOL> from flask import request , current_app <EOL> from flask_mail import Message <EOL> from logging import Handler , ERROR <EOL> from . . ext import mail <EOL> def loader_meta ( app = None ) : <EOL> """<STR_LIT>""" <EOL> from . views import core <EOL> app . register_blueprint ( core ) <EOL> from . ext import admin <EOL> admin . init_app ( app ) <EOL> from flask_bootstrap import Bootstrap <EOL> bootstrap = Bootstrap ( ) <EOL> bootstrap . init_app ( app ) <EOL> from flask import render_template <EOL> app . errorhandler ( <NUM_LIT> ) ( lambda e : ( render_template ( '<STR_LIT>' ) , <NUM_LIT> ) ) <EOL> if not app . debug and app . config . get ( '<STR_LIT>' ) : <EOL> mailhandler = FlaskMailHandler ( ERROR ) <EOL> app . logger . addHandler ( mailhandler ) <EOL> loader_meta . priority = <NUM_LIT> <EOL> class FlaskMailHandler ( Handler ) : <EOL> """<STR_LIT>""" <EOL> def emit ( self , record ) : <EOL> sbj = "<STR_LIT>" % ( request . host_url . rstrip ( '<STR_LIT:/>' ) , request . path ) <EOL> body = self . format ( record ) or '<STR_LIT>' <EOL> msg = Message ( sbj , body = body , recipients = current_app . config . get ( '<STR_LIT>' , [ ] ) ) <EOL> mail . send ( msg ) </s>
