Package DebTorrent
[hide private]
[frames] | no frames]

Package DebTorrent

source code

The main package to implement the DebTorrent protocol.

This package, and it's subpackage BT1, contains all the modules needed to implement the DebTorrent protocol.

Submodules [hide private]

Functions [hide private]
string
createPeerID(ins='---')
Generate a somewhat random peer ID
source code
string
make_readable(s)
Convert a string peer ID to be human-readable.
source code
 
resetPeerIDs()
Reset the generation of peer IDs before generating a new random one.
source code
Variables [hide private]
  _idprefix = 'T014--'
  _idrandom = ['r7VMERo1K-a']
logging.Logger logger = logging.getLogger('DebTorrent')
the logger to send all log messages to for this module
string mapbase64 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm...
the mapping from 64 bit numbers to string characters
string product_name = 'DebTorrent'
the name given for the package
string protocol_name = 'DebTorrent/0.1'
the protocol name to use in handshaking
  report_email = 'debtorrent-devel@lists.alioth.debian.org'
  subver = 4
  version = 'T-0.1.4 (DebTorrent)'
string version_short = 'T-0.1.4'
the short version number

Imports: DebTorrent.__init__, types.StringType, binascii.b2a_hex, time.clock, DebTorrent.getpid, logging, urllib.quote, sha.sha, time.time


Function Details [hide private]

createPeerID(ins='---')

source code 
Generate a somewhat random peer ID
Parameters:
  • ins (string) - the length 3 string to insert in the middle of the peer ID between the prefix and the random part of the ID (optional, defaults to '---')
Returns: string
the peer ID to use

make_readable(s)

source code 
Convert a string peer ID to be human-readable.
Parameters:
  • s (string) - the string to convert
Returns: string
the resulting hex string, or the original string if it was already readable

Variables Details [hide private]

mapbase64

the mapping from 64 bit numbers to string characters
Type:
string
Value:
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-'