Package DebTorrent :: Module parsedir
[hide private]
[frames] | no frames]

Module parsedir

source code

Parse a directory for torrent files.

Functions [hide private]
(dictionary, dictionary, dictionary, dictionary, dictionary)
parsedir(directory, parsed, files, blocked, exts=['dtorrent'], return_metainfo=True)
Parse a directory for torrent files.
source code
Variables [hide private]
logging.Logger logger = logging.getLogger('DebTorrent.parsedir')
the logger to send all log messages to for this module

Imports: bencode.bencode, bencode.bdecode, download_bt1.get_response, os.path.exists, os.path.isfile, sha.sha, sys, os, logging


Function Details [hide private]

parsedir(directory, parsed, files, blocked, exts=['dtorrent'], return_metainfo=True)

source code 

Parse a directory for torrent files.

Only works for .dtorrent files, it will not find or properly parse Packages files to extract the torrent from them.
Parameters:
  • directory (string) - the directory to parse (somewhat recursively)
  • parsed (dictionary) - the cache of all torrent files that were ever found
  • files (dictionary) - the files that were previously found
  • blocked (dictionary) - the files that were previously blocked
  • exts (list of string) - the extensions to look for torrent files in (optional, defaults to 'dtorrent')
  • return_metainfo (boolean) - whether to return the torrent metainfo (optional, defaults to False)
Returns: (dictionary, dictionary, dictionary, dictionary, dictionary)
the cache of all torrents ever found, all the files found, all the files blocked, the new torrents that were found, the torrents that are now missing