for i in range(len(eta_string_array), 4):
eta.insert(0, 0)
- # adriana >:)
- eta2 = datetime.timedelta(eta[0], eta[3], 0, 0, eta[2], eta[1], 0)
- eta_seconds = eta.days * 24 * 3600 + eta.seconds
- return eta_seconds
- #return eta
+ eta_td = datetime.timedelta(eta[0], eta[3], 0, 0, eta[2], eta[1], 0)
+ return eta_td
#
# sample libtorrent status line
pass
if pair[0] == "eta":
eta = libtorrent_canon_eta(pair[1])
+ eta_seconds = eta.days * 24 * 3600 + eta.seconds
- return (num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta)
+ return (num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_seconds)
def libtorrent_parse_status_file(dbw, client_session_id, session_start, filename):
if libtorrent_is_status_line(line) == False:
continue
- (num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_time) = libtorrent_parse_status_line(line)
+ (num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_seconds) = libtorrent_parse_status_line(line)
message_time = message_time + one_second
if DEBUG == True:
print "(%d, %s, %s, %d, %d kb/s, %d kb/s, %d bytes, %d bytes)" % (num_peers, date, time, dht, download_speed, upload_speed, download_size, upload_size)
- dbw.add_status_message_datetime(client_session_id, message_time, num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_time)
+ dbw.add_status_message_datetime(client_session_id, message_time, num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_seconds)
except IOError:
print "Error processing file %s." %filename