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

All Samples(18)  |  Call(9)  |  Derive(0)  |  Import(9)

        def make_meta_files(url, files, flag=Event(), progressfunc=dummy,
                    filefunc=dummy, piece_len_pow2=None, target=None,
                    comment=None, filesystem_encoding=None, created_by=None):
    if len(files) > 1 and target:
        raise BTFailure("You can't specify the name of the .torrent file when "
                        "generating multiple torrents at once")

    if not filesystem_encoding:
        try:
            sys.getfilesystemencoding
        except AttributeError:
            pass
        else:
            filesystem_encoding = sys.getfilesystemencoding()
        if not filesystem_encoding:
            filesystem_encoding = 'ascii'
    try:
        'a1'.decode(filesystem_encoding)
    except:
        raise BTFailure('Filesystem encoding "'+filesystem_encoding+
                        '" is not supported in this version')
    files.sort()
    ext = '.torrent'

    togen = []
    for f in files:
        if not f.endswith(ext):
            togen.append(f)

    total = 0
    for f in togen:
        total += calcsize(f)

    subtotal = [0]
    def callback(x):
        subtotal[0] += x
        progressfunc(subtotal[0] / total)
    for f in togen:
        if flag.isSet():
            break
        t = os.path.split(f)
        if t[1] == '':
            f = t[0]
        filefunc(f)
        make_meta_file(f, url, flag=flag, progress=callback,
                       piece_len_exp=piece_len_pow2, target=target,
                       comment=comment, encoding=filesystem_encoding, created_by=created_by)
        


src/k/a/kamaelia-HEAD/Sketches/RJL/bittorrent/BitTorrent/maketorrent-console.py   kamaelia(Download)
from BitTorrent.defaultargs import get_defaults
from BitTorrent import configfile
from BitTorrent.makemetafile import make_meta_files
from BitTorrent.parseargs import parseargs, printHelp
from BitTorrent import BTFailure
    else:
        try:
            make_meta_files(args[0],
                            args[1:],
                            progressfunc=prog,

src/k/a/kamaelia-HEAD/Sketches/RJL/Packages/Kamaelia/Community/RJL/Kamaelia/Protocol/Torrent/TorrentMaker.py   kamaelia(Download)
#from BitTorrent.defaultargs import get_defaults
#from BitTorrent import configfile
from BitTorrent.makemetafile import make_meta_files
from BitTorrent.parseargs import parseargs, printHelp
from BitTorrent import BTFailure
 
            make_meta_files(
                url=request.trackerurl,
                files=[(request.srcfile).decode(le)],
                piece_len_pow2=request.log2piecesizebytes,

src/k/a/kamaelia-HEAD/Sketches/RJL/Kamaelia/Community/RJL/Kamaelia/Protocol/Torrent/TorrentMaker.py   kamaelia(Download)
#from BitTorrent.defaultargs import get_defaults
#from BitTorrent import configfile
from BitTorrent.makemetafile import make_meta_files
from BitTorrent.parseargs import parseargs, printHelp
from BitTorrent import BTFailure
 
            make_meta_files(
                url=request.trackerurl,
                files=[(request.srcfile).decode(le)],
                piece_len_pow2=request.log2piecesizebytes,

src/k/a/kamaelia-HEAD/Code/Python/Kamaelia/Kamaelia/Protocol/Torrent/TorrentMaker.py   kamaelia(Download)
#from BitTorrent.defaultargs import get_defaults
#from BitTorrent import configfile
from BitTorrent.makemetafile import make_meta_files
from BitTorrent.parseargs import parseargs, printHelp
from BitTorrent import BTFailure
 
            make_meta_files(
                url=request.trackerurl,
                files=[(request.srcfile).decode(le)],
                piece_len_pow2=request.log2piecesizebytes,

src/k/a/kamaelia-HEAD/Sketches/RJL/bittorrent/BitTorrent/maketorrent.py   kamaelia(Download)
from BitTorrent import configfile
from BitTorrent.defaultargs import get_defaults
from BitTorrent.makemetafile import make_meta_files
from BitTorrent.parseargs import makeHelp
from BitTorrent.platform import btspawn
    def complete(self):
        try:
            make_meta_files(self.announce, 
                            self.file_list,
                            flag=self.flag,

src/k/a/kamaelia-HEAD/Sketches/RJL/Torrent/TorrentMaker.py   kamaelia(Download)
#from BitTorrent.defaultargs import get_defaults
#from BitTorrent import configfile
from BitTorrent.makemetafile import make_meta_files
from BitTorrent.parseargs import parseargs, printHelp
from BitTorrent import BTFailure
 
            make_meta_files(
                url=request.trackerurl,
                files=[(request.srcfile).decode(le)],
                piece_len_pow2=request.log2piecesizebytes,

src/u/p/UploadFu-0.5/uploadfu/__init__.py   UploadFu(Download)
                        base_name = os.path.basename(dir_to_upload)
                        logger = logging.getLogger("upload.%s" % base_name.replace('.','_'))
                        from BitTorrent.makemetafile import make_meta_files
                        target = os.path.join(WORK_DIR, '%s.torrent' % base_name)
                        args = [
                            print '%.1f%% complete\r' % (amount * 100),
                        logger.info('Making: %s' % target)
                        make_meta_files(args[0], args[1:], piece_len_pow2=int(config['piece_size']), progressfunc=prog, filefunc=dc, comment=config.get('torrent_comment', None), target=target, filesystem_encoding='', created_by=__version__)
 
 

src/k/a/Kamaelia-0.6.0/Kamaelia/Protocol/Torrent/TorrentMaker.py   Kamaelia(Download)
#from BitTorrent.defaultargs import get_defaults
#from BitTorrent import configfile
from BitTorrent.makemetafile import make_meta_files
from BitTorrent.parseargs import parseargs, printHelp
from BitTorrent import BTFailure
 
            make_meta_files(
                url=request.trackerurl,
                files=[(request.srcfile).decode(le)],
                piece_len_pow2=request.log2piecesizebytes,

src/k/a/kamaelia-HEAD/Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Protocol/Torrent/TorrentMaker.py   kamaelia(Download)
#from BitTorrent.defaultargs import get_defaults
#from BitTorrent import configfile
from BitTorrent.makemetafile import make_meta_files
from BitTorrent.parseargs import parseargs, printHelp
from BitTorrent import BTFailure
 
            make_meta_files(
                url=request.trackerurl,
                files=[(request.srcfile).decode(le)],
                piece_len_pow2=request.log2piecesizebytes,