mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-18 14:26:24 +00:00
Fix stuff for updated bindings.
This commit is contained in:
parent
c35553d4a8
commit
5f2be57ba8
@ -72,7 +72,7 @@ class Torrent:
|
|||||||
|
|
||||||
# Holds status info so that we don't need to keep getting it from lt
|
# Holds status info so that we don't need to keep getting it from lt
|
||||||
self.status = self.handle.status()
|
self.status = self.handle.status()
|
||||||
self.torrent_info = self.handle.torrent_info()
|
self.torrent_info = self.handle.get_torrent_info()
|
||||||
|
|
||||||
# Set the initial state
|
# Set the initial state
|
||||||
self.state = "Checking"
|
self.state = "Checking"
|
||||||
@ -133,7 +133,7 @@ class Torrent:
|
|||||||
|
|
||||||
def set_private_flag(self, private):
|
def set_private_flag(self, private):
|
||||||
self.private = private
|
self.private = private
|
||||||
self.handle.torrent_info().set_priv(private)
|
self.handle.get_torrent_info().set_priv(private)
|
||||||
|
|
||||||
def set_prioritize_first_last(self, prioritize):
|
def set_prioritize_first_last(self, prioritize):
|
||||||
self.prioritize_first_last = prioritize
|
self.prioritize_first_last = prioritize
|
||||||
@ -205,7 +205,7 @@ class Torrent:
|
|||||||
def get_files(self):
|
def get_files(self):
|
||||||
"""Returns a list of files this torrent contains"""
|
"""Returns a list of files this torrent contains"""
|
||||||
if self.torrent_info == None:
|
if self.torrent_info == None:
|
||||||
torrent_info = self.handle.torrent_info()
|
torrent_info = self.handle.get_torrent_info()
|
||||||
else:
|
else:
|
||||||
torrent_info = self.torrent_info
|
torrent_info = self.torrent_info
|
||||||
|
|
||||||
@ -233,16 +233,16 @@ class Torrent:
|
|||||||
for peer in peers:
|
for peer in peers:
|
||||||
# Find the progress
|
# Find the progress
|
||||||
num_pieces_complete = 0
|
num_pieces_complete = 0
|
||||||
for piece in peer["pieces"]:
|
for piece in peer.pieces:
|
||||||
if piece:
|
if piece:
|
||||||
num_pieces_complete += 1
|
num_pieces_complete += 1
|
||||||
progress = num_pieces_complete / len(peer["pieces"]) * 100
|
progress = num_pieces_complete / len(peer.pieces) * 100
|
||||||
ret.append({
|
ret.append({
|
||||||
"ip": peer["ip"],
|
"ip": peer.ip,
|
||||||
"up_speed": peer["up_speed"],
|
"up_speed": peer.up_speed,
|
||||||
"down_speed": peer["down_speed"],
|
"down_speed": peer.down_speed,
|
||||||
"country": peer["country"],
|
"country": peer.country,
|
||||||
"client": deluge.xmlrpclib.Binary(peer["client"]),
|
"client": deluge.xmlrpclib.Binary(peer.client),
|
||||||
"progress": progress
|
"progress": progress
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ class Torrent:
|
|||||||
"""Returns the status of the torrent based on the keys provided"""
|
"""Returns the status of the torrent based on the keys provided"""
|
||||||
# Create the full dictionary
|
# Create the full dictionary
|
||||||
self.status = self.handle.status()
|
self.status = self.handle.status()
|
||||||
self.torrent_info = self.handle.torrent_info()
|
self.torrent_info = self.handle.get_torrent_info()
|
||||||
|
|
||||||
# Adjust progress to be 0-100 value
|
# Adjust progress to be 0-100 value
|
||||||
progress = self.status.progress * 100
|
progress = self.status.progress * 100
|
||||||
@ -498,7 +498,7 @@ class Torrent:
|
|||||||
self.filename),
|
self.filename),
|
||||||
"wb")
|
"wb")
|
||||||
if filedump == None:
|
if filedump == None:
|
||||||
filedump = self.handle.torrent_info().create_torrent()
|
filedump = self.handle.get_torrent_info().create_torrent()
|
||||||
save_file.write(lt.bencode(filedump))
|
save_file.write(lt.bencode(filedump))
|
||||||
save_file.close()
|
save_file.close()
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user