示例#1
0
def process_sources():
    with download_sources() as info:
        fd, suite = info
        with tmpfile():
            f = gzip.open(fd, 'r')
            try:
                yield (f, suite)
            finally:
                pass
            f.close()
示例#2
0
def download_sources():
    with tmpfile() as fd:
        f = urllib2.urlopen(get_sources_uri())
        open(fd, 'w').write(f.read())
        yield (fd, _get_context())