Package DebTorrent :: Package BT1 :: Module Rerequester
[hide private]
[frames] | no frames]

Module Rerequester

source code

Communicate with a tracker.

Classes [hide private]
  fakeflag
A fake flag to use if one is not supplied.
  Rerequester
Communicate with a tracker.
  SuccessLock
Locks to synchronize threaded requests to trackers.
Functions [hide private]
 
add_key(tracker)
Create a random base64 key to send to the tracker.
source code
string
get_key(tracker)
Get the query parameter for the key to send to the tracker.
source code
Variables [hide private]
logging.Logger logger = logging.getLogger('DebTorrent.BT1.Rerequester')
the logger to send all log messages to for this module
string mapbase64 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm...
the 64 characters to use for a base64 representation
dictionary keys = {}
the key parameters to send to tracker, keys are the announce addresses
string basekeydata = '116791187566005.6354041tracker'
semi-random data to use to create the key

Imports: zurllib.urlopen, zurllib.quote, urlparse.urlparse, urlparse.urlunparse, btformats.check_peers, bencode.bdecode, threading.Thread, threading.Lock, cStringIO.StringIO, traceback.print_exc, socket.error, socket.gethostbyname, random.shuffle, sha.sha, time.time, logging, getpid


Function Details [hide private]

add_key(tracker)

source code 
Create a random base64 key to send to the tracker.
Parameters:
  • tracker (string) - the announce address for the tracker

get_key(tracker)

source code 
Get the query parameter for the key to send to the tracker.
Parameters:
  • tracker (string) - the announce address for the tracker
Returns: string
the query parameter to send to the tracker

Variables Details [hide private]

mapbase64

the 64 characters to use for a base64 representation
Type:
string
Value:
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-'