#NEWLINE# def process_request( self , request ) : #NEWLINE# #INDENT# is_mobile = False #NEWLINE# if ( 'HTTP_USER_AGENT' in request . META ) : #NEWLINE# #INDENT# user_agent = request . META [ 'HTTP_USER_AGENT' ] #NEWLINE# if ( self . user_agents_test_search_regex . search ( user_agent ) and ( not self . user_agents_exception_search_regex . search ( user_agent ) ) ) : #NEWLINE# #INDENT# is_mobile = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'HTTP_ACCEPT' in request . META ) : #NEWLINE# #INDENT# http_accept = request . META [ 'HTTP_ACCEPT' ] #NEWLINE# if self . http_accept_regex . search ( http_accept ) : #NEWLINE# #INDENT# is_mobile = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not is_mobile ) : #NEWLINE# #INDENT# if self . user_agents_test_match_regex . match ( user_agent ) : #NEWLINE# #INDENT# is_mobile = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if self : #NEWLINE# #INDENT# set_flavour ( settings . DEFAULT_MOBILE_FLAVOUR , request ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# set_flavour ( settings . FLAVOURS [ 0 ] , request )