Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(5)  |  Derive(0)  |  Import(5)
Parse a list of torrent hashes in the form of one hash per line in
hex format

        def parsetorrentlist(filename, parsed):
    """Parse a list of torrent hashes in the form of one hash per line in
    hex format"""
    base_error = '*** WARNING *** line in torrent list '
    new_parsed = {}
    added = {}
    with open(filename, 'r') as listfile:
        for line in listfile:
            l = line.strip()
            if len(l) != 40:
                print base_error + 'incorrect length: ' + l
                continue

            try:
                h = unhexlify(l)
                if h not in parsed:
                    added[h] = True
                new_parsed[h] = True
            except TypeError:
                print base_error + 'has non-hex digits: ' + l
    return (new_parsed, added)
        


src/o/w/OwnTube-HEAD/videoportal/BitTornadoABC/BitTornado/BT1/track.py   OwnTube(Download)
from BitTornado.subnetparse import IP_List, ipv6_to_ipv4, to_ipv4, is_valid_ip, is_ipv4
from BitTornado.iprangeparse import IP_List as IP_Range_List
from BitTornado.torrentlistparse import parsetorrentlist
from threading import Event, Thread
from BitTornado.bencode import bencode, bdecode, Bencached
                return
            try:
                r = parsetorrentlist(f, self.allowed)
                (self.allowed, added, garbage2) = r
                self.state['allowed_list'] = self.allowed

src/f/r/FriendlyTorrent-HEAD/src/tornado/BitTornado/BT1/track.py   FriendlyTorrent(Download)
from BitTornado.subnetparse import IP_List, ipv6_to_ipv4, to_ipv4, is_valid_ip, is_ipv4
from BitTornado.iprangeparse import IP_List as IP_Range_List
from BitTornado.torrentlistparse import parsetorrentlist
from threading import Event, Thread
from BitTornado.bencode import bencode, bdecode, Bencached
                return
            try:
                r = parsetorrentlist(f, self.allowed)
                (self.allowed, added, garbage2) = r
                self.state['allowed_list'] = self.allowed

src/h/e/Herd-HEAD/BitTornado/BT1/track.py   Herd(Download)
from BitTornado.subnetparse import IP_List, ipv6_to_ipv4, to_ipv4, is_valid_ip, is_ipv4
from BitTornado.iprangeparse import IP_List as IP_Range_List
from BitTornado.torrentlistparse import parsetorrentlist
from threading import Event, Thread
from BitTornado.bencode import bencode, bdecode, Bencached
                return
            try:
                r = parsetorrentlist(f, self.allowed)
                (self.allowed, added, garbage2) = r
                self.state['allowed_list'] = self.allowed

src/b/i/BitTornado-HEAD/BitTornado/BT1/track.py   BitTornado(Download)
from BitTornado.BTcrypto import CRYPTO_OK
from T2T import T2TList
from BitTornado.torrentlistparse import parsetorrentlist
from BitTornado.bencode import bencode, bdecode, Bencached
from BitTornado.zurllib import urlopen
                return
            try:
                r = parsetorrentlist(f, self.allowed)
                (self.allowed, added) = r
                self.state['allowed_list'] = self.allowed

src/s/w/swarm-HEAD/BitTornado/BT1/track.py   swarm(Download)
from BitTornado.subnetparse import IP_List, ipv6_to_ipv4, to_ipv4, is_valid_ip, is_ipv4
from BitTornado.iprangeparse import IP_List as IP_Range_List
from BitTornado.torrentlistparse import parsetorrentlist
from threading import Event, Thread
from BitTornado.bencode import bencode, bdecode, Bencached
                return
            try:
                r = parsetorrentlist(f, self.allowed)
                (self.allowed, added, garbage2) = r
                self.state['allowed_list'] = self.allowed