#NEWLINE# def get_users_live_versions( app_id , start , end , tz = 'UTC' ) : #NEWLINE# #INDENT# win_versions = [ str ( v . version ) for v in Version . objects . filter_by_enabled ( app__id = app_id ) ] #NEWLINE# mac_versions = [ str ( v . short_version ) for v in SparkleVersion . objects . filter_by_enabled ( app__id = app_id ) ] #NEWLINE# tmp_hours = divmod ( ( end - start ) . total_seconds ( ) , ( 60 * 60 ) ) #NEWLINE# n_hours = ( tmp_hours [ 0 ] + 1 ) #NEWLINE# n_hours = int ( n_hours ) #NEWLINE# win_data = get_versions_data_by_platform ( app_id , end , n_hours , win_versions , 'win' , tz = tz ) #NEWLINE# mac_data = get_versions_data_by_platform ( app_id , end , n_hours , mac_versions , 'mac' , tz = tz ) #NEWLINE# data = dict ( win = win_data , mac = mac_data ) #NEWLINE# return data