#NEWLINE# def get( self ) : #NEWLINE# #INDENT# self . version_filter = self . request . GET . get ( 'versions' , 'all' ) #NEWLINE# self . sender = self . request . GET [ 'sender' ] #NEWLINE# self . to = self . request . GET . get ( 'to' , None ) #NEWLINE# report_date = self . request . GET . get ( 'date' , None ) #NEWLINE# if report_date : #NEWLINE# #INDENT# self . yesterday = datetime . date ( * [ int ( x ) for x in report_date . split ( '-' ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . yesterday = ( datetime . date . today ( ) - datetime . timedelta ( days = 1 ) ) #NEWLINE# #UNINDENT# self . app_id = os . environ [ 'APPLICATION_ID' ] #NEWLINE# version = os . environ [ 'CURRENT_VERSION_ID' ] #NEWLINE# ( self . major_version , self . minor_version ) = version . rsplit ( '.' , 1 ) #NEWLINE# self . minor_version = int ( self . minor_version ) #NEWLINE# self . max_results = int ( self . request . GET . get ( 'max_results' , self . DEFAULT_MAX_RESULTS ) ) #NEWLINE# self . debug = isTrue ( self . request . GET . get ( 'debug' , 'false' ) ) #NEWLINE# self . delete = isTrue ( self . request . GET . get ( 'delete' , 'true' ) ) #NEWLINE# namespace_manager . set_namespace ( '' ) #NEWLINE# try : #NEWLINE# #INDENT# exceptions = self . GetQuery ( order = '-minor_version' ) . fetch ( self . max_results ) #NEWLINE# #UNINDENT# except db . NeedIndexError : #NEWLINE# #INDENT# exceptions = self . GetQuery ( ) . fetch ( self . max_results ) #NEWLINE# #UNINDENT# if exceptions : #NEWLINE# #INDENT# report = self . GenerateReport ( exceptions ) #NEWLINE# if self . debug : #NEWLINE# #INDENT# self . response . out . write ( report ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . SendReport ( report ) #NEWLINE# #UNINDENT# if self . delete : #NEWLINE# #INDENT# db . delete ( exceptions )