Package DebTorrent :: Package BT1 :: Module makemetafile :: Class TorrentCreator
[hide private]
[frames] | no frames]

Class TorrentCreator

source code

Create a torrent metainfo from a downloaded Packages file (threaded).

Instance Methods [hide private]
 
__init__(self, path, data, callback, sched, separate_all=0)
Process a downloaded Packages file and start the torrent making thread.
source code
 
_create(self)
Process a downloaded Packages file and start a torrent.
source code
dictionary
_create_response(self, info, headers, name)
Create a response from an info dictionary and some torrent headers.
source code
 
_finished(self)
Wrap up the creation and call the callback function.
source code
Method Details [hide private]

__init__(self, path, data, callback, sched, separate_all=0)
(Constructor)

source code 
Process a downloaded Packages file and start the torrent making thread.
Parameters:
  • path (list of string) - the path of the file to download, starting with the mirror name
  • data (string) - the downloaded Packages file
  • callback (method) - the method to call with the torrent when it has been created
  • sched (method) - the method to call to schedule future invocation of a function
  • separate_all (boolean) - whether to separate the architecture:all packages into a separate torrent (optional, defaults to False)

_create_response(self, info, headers, name)

source code 
Create a response from an info dictionary and some torrent headers.
Parameters:
  • info (dictionary) - the info dictionary to use for the torrent
  • headers (dictionary) - the headers from the torrent file
  • name (string) - the name to use for the torrent
Returns: dictionary
the metainfo dictionary of the torrent, or None if there was a problem