Package DebTorrent :: Package BT1 :: Module T2T :: Class T2TList
[hide private]
[frames] | no frames]

Class T2TList

source code

A list of all tracker to tracker connections.

Instance Methods [hide private]
 
__init__(self, enabled, trackerid, interval, maxpeers, timeout, rawserver)
Initialize the instance.
source code
 
parse(self, allowed_list)
Parse a list of allowed torrents and enable any new ones.
source code
 
_disallow(self, tracker)
Disallow all connections from contacting a tracker.
source code
boolean
_isdisallowed(self, tracker)
Check if a tracker has been disallowed.
source code
list of (string, string, int)
harvest(self, hash)
Harvest a list of peers from all tracker's for a torrent.
source code
Instance Variables [hide private]
{string: boolean, ...} disallowed
keys are the tracker addresses, values are True if the tracker is disallowing this tracker
boolean enabled
whether to enable multitracker operation
int interval
seconds between outgoing tracker announces
{string: {string: T2TConnection, ...}, ...} list
keys are the tracker addresses, values are dictionaries with torrent info hashes as keys and the connection to that tracker for that torrent as values
int maxpeers
number of peers to get in a tracker announce
list of T2TConnection oldtorrents
deactivated connections that are kept in case threads try to access them
DebTorrent.RawServer.RawServer rawserver
the server instance to use
int timeout
number of seconds to wait before assuming that a tracker connection has timed out
{string: [T2TConnection, ...], ...} torrents
keys are the info hashes, values are a list of the tracker connections for that torrent
string trackerid
this tracker's ID
Method Details [hide private]

__init__(self, enabled, trackerid, interval, maxpeers, timeout, rawserver)
(Constructor)

source code 
Initialize the instance.
Parameters:
  • enabled (boolean) - whether to enable multitracker operation
  • trackerid (string) - this tracker's ID
  • interval (int) - seconds between outgoing tracker announces
  • maxpeers (int) - number of peers to get in a tracker announce
  • timeout (int) - number of seconds to wait before assuming that a tracker connection has timed out
  • rawserver (DebTorrent.RawServer.RawServer) - the server instance to use

parse(self, allowed_list)

source code 
Parse a list of allowed torrents and enable any new ones.
Parameters:
  • allowed_list (dictionary) - keys are info hashes, values are the torrent data

_disallow(self, tracker)

source code 
Disallow all connections from contacting a tracker.
Parameters:
  • tracker (string) - the tracker address to disallow

_isdisallowed(self, tracker)

source code 
Check if a tracker has been disallowed.
Parameters:
  • tracker (string) - the tracker address to check
Returns: boolean
whether the tracker has been disallowed

harvest(self, hash)

source code 
Harvest a list of peers from all tracker's for a torrent.
Parameters:
  • hash (string) - the info hash of the torrent to get peers for
Returns: list of (string, string, int)
the list of peer data of peer ID, IP address, and port