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

All Samples(19)  |  Call(10)  |  Derive(0)  |  Import(9)

        def bdecode(x):
    try:
        r, l = decode_func[x[0]](x, 0)
    except (IndexError, KeyError, ValueError):
        raise BTFailure, 'not a valid bencoded string'
    if l != len(x):
        raise BTFailure, 'invalid bencoded value (data after valid prefix)'
    return r
        


src/a/n/Anomos-HEAD/anonreannounce.py   Anomos(Download)
 
from sys import argv
from Anomos.bencode import bencode, bdecode
 
if len(argv) < 3:
for f in argv[2:]:
    h = open(f, 'rb')
    metainfo = bdecode(h.read())
    h.close()
    if metainfo['announce'] != argv[1]:

src/a/n/Anomos-HEAD/anomosify.py   Anomos(Download)
## Patches, Flames: rich@anomos.info
 
from Anomos.bencode import bdecode, bencode
import os
import sys
import getopt
 
def anomosify(data, announce="https://tracker.anomos.info:5555/announce"):
 
	r = bdecode(data)

src/a/n/Anomos-HEAD/anondownloadgui.py   Anomos(Download)
from Anomos.parseargs import parseargs, makeHelp
from Anomos.GUI import *
from Anomos.bencode import bdecode, bencode
from Anomos import configfile
from Anomos import HELP_URL, DONATE_URL
def anomosify(data, config):
 
	r = bdecode(data)
	if 'announce-list' in r:
	    for a,l in enumerate(r['announce-list']):

src/a/n/Anomos-HEAD/Anomos/parsedir.py   Anomos(Download)
import hashlib
 
from Anomos.bencode import bencode, bdecode
from Anomos.btformats import check_message
 
        try:
            ff = open(p, 'rb')
            d = bdecode(ff.read())
            check_message(d)
            h = hashlib.sha1(bencode(d['info'])).digest()

src/a/n/Anomos-HEAD/Anomos/TorrentQueue.py   Anomos(Download)
from Anomos.download import Feedback, Multitorrent
from Anomos.controlsocket import ControlSocket
from Anomos.bencode import bdecode
from Anomos.ConvertedMetainfo import ConvertedMetainfo
from Anomos import BTFailure, BTShutdown
            self.torrents[infohash] = t
            try:
                t.metainfo = ConvertedMetainfo(bdecode(data))
            except Exception, e:
                self.global_error("ERROR", "Corrupt data in "+path+
    def start_new_torrent(self, data):
        t = Torrent()
        try:
            t.metainfo = ConvertedMetainfo(bdecode(data))
        except Exception, e:

src/a/n/Anomos-HEAD/Anomos/Rerequester.py   Anomos(Download)
import Anomos.Crypto
 
from Anomos.bencode import bdecode
from Anomos.btformats import check_peers
 
        try:
            # Here's where we receive/decrypt data from the tracker
            r = bdecode(data)
            check_peers(r)
        except BTFailure, e:
                self._postrequest(errormsg=r)
 
        return bdecode(data)
 

src/a/n/Anomos-HEAD/anondownloadheadless.py   Anomos(Download)
from Anomos.defaultargs import get_defaults
from Anomos.parseargs import parseargs, printHelp
from Anomos.bencode import bdecode
from Anomos.ConvertedMetainfo import ConvertedMetainfo
from Anomos import configfile
            self.multitorrent = Multitorrent(self.config, self.doneflag)
            # raises BTFailure if bad
            metainfo = ConvertedMetainfo(bdecode(self.metainfo))
            torrent_name = metainfo.name_fs
            if config['save_as']:

src/a/n/Anomos-HEAD/anondownloadcurses.py   Anomos(Download)
from Anomos.defaultargs import get_defaults
from Anomos.parseargs import parseargs, printHelp
from Anomos.bencode import bdecode
from Anomos.ConvertedMetainfo import ConvertedMetainfo
from Anomos import configfile
            self.multitorrent = Multitorrent(self.config, self.doneflag)
            # raises BTFailure if bad
            metainfo = ConvertedMetainfo(bdecode(self.metainfo))
            torrent_name = metainfo.name_fs
            if config['save_as']:

src/a/n/Anomos-HEAD/Anomos/track.py   Anomos(Download)
from Anomos.TwistedNatCheck import NatCheckCTXFactory, NatChecker
from Anomos.NetworkModel import NetworkModel
from Anomos.bencode import bencode, bdecode, Bencached
from Anomos.parseargs import parseargs, formatDefinitions
from Anomos.parsedir import parsedir