Package DebTorrent :: Package BT1 :: Module Downloader :: Class BadDataGuard
[hide private]
[frames] | no frames]

Class BadDataGuard

source code

Process good and bad received pieces from a single peer.

Instance Methods [hide private]
 
__init__(self, download)
Initialize the class.
source code
 
failed(self, index, bump=True)
Process the failed piece.
source code
 
good(self, index)
Process the successful piece.
source code
Instance Variables [hide private]
SingleDownload download
the SingleDownload instance
Downloader downloader
the Downloader instance
string ip
IP address of the peer
int lastindex
the last good piece that was received
PerIPStats stats
the PerIPStats instance
Method Details [hide private]

__init__(self, download)
(Constructor)

source code 
Initialize the class.
Parameters:
  • download (SingleDownload) - the SingleDownload instance for the download

failed(self, index, bump=True)

source code 
Process the failed piece.
Parameters:
  • index (int) - the piece that failed
  • bump (boolean) - whether to decrease the interest level in the PiecePicker.PiecePicker (optional, defaults to False)

good(self, index)

source code 
Process the successful piece.
Parameters:
  • index (int) - the piece that succeeded