#NEWLINE# @ classmethod #NEWLINE# def ListClientLogs( cls , user_id , start_timestamp , end_timestamp , filter , callback ) : #NEWLINE# #INDENT# 'Queries S3 based on specified "user_id", and the specified\n    array of ISO date strings. The results are filtered according to\n    the regular expression "filter". Returns an array of {filename,\n    URL} objects for each date in "iso_dates".\n    ' #NEWLINE# obj_store = ObjectStore . GetInstance ( ObjectStore . USER_LOG ) #NEWLINE# def _OnListDates( date_listings ) : #NEWLINE# #INDENT# 'Assemble {filename, url} objects for each date listing.' #NEWLINE# filter_re = re . compile ( ( filter or '.*' ) ) #NEWLINE# callback ( [ { #NEWLINE# #INDENT# 'filename' : key , #NEWLINE# 'url' : obj_store . GenerateUrl ( key ) , #NEWLINE# #UNINDENT# } for logs in date_listings for key in logs if filter_re . search ( key ) ] ) #NEWLINE# #UNINDENT# with util . ArrayBarrier ( _OnListDates ) as b : #NEWLINE# #INDENT# iso_dates = set ( ) #NEWLINE# t = start_timestamp #NEWLINE# while ( t < end_timestamp ) : #NEWLINE# #INDENT# iso_dates . add ( ClientLog . _IsoDate ( t ) ) #NEWLINE# t += constants . SECONDS_PER_DAY #NEWLINE# #UNINDENT# iso_dates . add ( ClientLog . _IsoDate ( end_timestamp ) ) #NEWLINE# iso_dates = sorted ( iso_dates ) #NEWLINE# for iso_date in iso_dates : #NEWLINE# #INDENT# ClientLog . _ListAllKeys ( obj_store , ClientLog . _LogKeyPrefix ( user_id , iso_date ) , b . Callback ( ) )