<s> from __future__ import unicode_literals <EOL> from flask import Flask , jsonify , redirect , send_from_directory , request <EOL> from sys import exit , stderr <EOL> try : <EOL> import config <EOL> except ImportError : <EOL> stderr . write ( "<STR_LIT>" ) <EOL> exit ( <NUM_LIT:1> ) <EOL> from shared import db , limiter <EOL> from controllers import * <EOL> from utils import Error <EOL> if config . google_api_key == '<STR_LIT>' : <EOL> stderr . write ( "<STR_LIT>" ) <EOL> app = Flask ( __name__ ) <EOL> app . config [ '<STR_LIT>' ] = config . database_uri <EOL> app . config [ '<STR_LIT>' ] = False ; <EOL> db . init_app ( app ) <EOL> limiter . init_app ( app ) <EOL> limiter . enabled = config . limiter <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def index ( ) : <EOL> return redirect ( '<STR_LIT>' ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def robots_txt ( ) : <EOL> return send_from_directory ( app . static_folder , request . path [ <NUM_LIT:1> : ] ) <EOL> @ app . errorhandler ( <NUM_LIT> ) <EOL> def limit_rate ( e ) : <EOL> return jsonify ( Error . RATE_TOOFAST ) <EOL> app . register_blueprint ( subscription ) <EOL> app . register_blueprint ( message ) <EOL> app . register_blueprint ( service ) <EOL> if config . google_api_key is not "<STR_LIT>" : <EOL> app . register_blueprint ( gcm ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> app . debug = True <EOL> app . run ( ) </s>
