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

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Replace announce and announce-list in info file

        def reannounce(fname, announce, announce_list=None, verbose=False):
    """Replace announce and announce-list in info file"""
    metainfo = MetaInfo.read(fname)

    if verbose:
        # Accept torrents with no announce
        if 'announce' in metainfo:
            print 'old announce for %s: %s' % (fname, metainfo['announce'])
        else:
            print 'No announce found.'

    metainfo['announce'] = announce

    if 'announce-list' in metainfo:
        if verbose:
            print 'old announce-list for {}: {}'.format(
                fname, '|'.join(','.join(tier)
                                for tier in metainfo['announce-list']))
        if announce_list is not None:
            metainfo['announce-list'] = announce_list
        else:
            metainfo.pop('announce-list', None)

    metainfo.write(fname)
        


src/b/i/BitTornado-HEAD/btreannounce.py   BitTornado(Download)
import getopt
from BitTornado.BT1.makemetafile import announcelist_details
from BitTornado.reannounce import reannounce
 
announce_details = """
 
    for fname in args[1:]:
        reannounce(fname, announce, announce_list, verbose)
 
if __name__ == '__main__':

src/b/i/BitTornado-HEAD/btcopyannounce.py   BitTornado(Download)
import getopt
from BitTornado.Info import MetaInfo
from BitTornado.reannounce import reannounce
 
 
 
    for fname in args[1:]:
        reannounce(fname, announce, announce_list, verbose)
 
    return 0