#NEWLINE# def init_app( self , app ) : #NEWLINE# #INDENT# self . app = app #NEWLINE# app . config . setdefault ( 'MOBILE_USER_AGENTS' , 'android|fennec|iemobile|iphone|opera (?:mini|mobi)|mobile' ) #NEWLINE# app . config . setdefault ( 'MOBILE_COOKIE' , 'mobile' ) #NEWLINE# self . USER_AGENTS = re . compile ( app . config . get ( 'MOBILE_USER_AGENTS' ) ) #NEWLINE# @ app . before_request #NEWLINE# def before_request( ) : #NEWLINE# #INDENT# ctx = stack . top #NEWLINE# if ( ( ctx is not None ) and hasattr ( ctx , 'request' ) ) : #NEWLINE# #INDENT# self . process_request ( ctx . request )