def _api_server_stats(name, output, kwargs):
 (sum_t, sum_m, sum_w, sum_d) = BPSMeter.do.get_sums()
 stats = {'total': sum_t, 'month': sum_m, 'week': sum_w, 'day': sum_d}
 stats['servers'] = {}
 for svr in config.get_servers():
  (t, m, w, d) = BPSMeter.do.amounts(svr)
  stats['servers'][svr] = {'total': (t or 0), 'month': (m or 0), 'week': (w or 0), 'day': (d or 0)}
 return report(output, keyword='', data=stats)

def _api_server_stats ( name , output , kwargs ) : ( sum_t , sum_m , sum_w , sum_d ) = BPSMeter . do . get_sums ( ) stats = { 'total' : sum_t , 'month' : sum_m , 'week' : sum_w , 'day' : sum_d } stats [ 'servers' ] = { } for svr in config . get_servers ( ) : ( t , m , w , d ) = BPSMeter . do . amounts ( svr ) stats [ 'servers' ] [ svr ] = { 'total' : ( t or 0 ) , 'month' : ( m or 0 ) , 'week' : ( w or 0 ) , 'day' : ( d or 0 ) } return report ( output , keyword = '' , data = stats )
api: accepts output .