Did I find the right examples for you? yes no

All Samples(14)  |  Call(8)  |  Derive(0)  |  Import(6)
Hack for making with statement work on two files with 2.6. 

            @wraps(func)
    def helper(*args, **kwds):
        return GeneratorContextManager(func(*args, **kwds))
        


src/b/l/bloscpack-0.6.0/bloscpack/file_io.py   bloscpack(Download)
from .serializers import (SERIALIZERS_LOOKUP,
)
from .util import (open_two_file,
                   )
from .abstract_io import (PlainSource,
    nchunks, chunk_size, last_chunk_size = \
            calculate_nchunks(in_file_size, chunk_size)
    with open_two_file(open(in_file, 'rb'), open(out_file, 'wb')) as \
            (input_fp, output_fp):
        source = PlainFPSource(input_fp)
    in_file_size = path.getsize(in_file)
    log.verbose('input file size: %s' % pretty_size(in_file_size))
    with open_two_file(open(in_file, 'rb'), open(out_file, 'wb')) as \
            (input_fp, output_fp):
        source = CompressedFPSource(input_fp)

src/b/l/bloscpack-HEAD/bloscpack/file_io.py   bloscpack(Download)
from .serializers import (SERIALIZERS_LOOKUP,
                          )
from .util import (open_two_file,
                   )
from .abstract_io import (PlainSource,
    nchunks, chunk_size, last_chunk_size = \
            calculate_nchunks(in_file_size, chunk_size)
    with open_two_file(open(in_file, 'rb'), open(out_file, 'wb')) as \
            (input_fp, output_fp):
        source = PlainFPSource(input_fp)
    in_file_size = path.getsize(in_file)
    log.verbose('input file size: %s' % pretty_size(in_file_size))
    with open_two_file(open(in_file, 'rb'), open(out_file, 'wb')) as \
            (input_fp, output_fp):
        source = CompressedFPSource(input_fp)

src/b/l/bloscpack-0.6.0/bloscpack/append.py   bloscpack(Download)
from .pretty import (double_pretty_size,
                     )
from .util import (open_two_file,
                   )
import log
    log.verbose('new file size: %s' % double_pretty_size(new_size))
 
    with open_two_file(open(orig_file, 'r+b'), open(new_file, 'rb')) as \
            (orig_fp, new_fp):
        append_fp(orig_fp, new_fp, new_size, blosc_args)

src/b/l/bloscpack-HEAD/bloscpack/append.py   bloscpack(Download)
from .pretty import (double_pretty_size,
                     )
from .util import (open_two_file,
                   )
import log
    log.verbose('new file size: %s' % double_pretty_size(new_size))
 
    with open_two_file(open(orig_file, 'r+b'), open(new_file, 'rb')) as \
            (orig_fp, new_fp):
        append_fp(orig_fp, new_fp, new_size, blosc_args)

src/b/l/bloscpack-0.6.0/bloscpack/testutil.py   bloscpack(Download)
from .defaults import (DEFAULT_CHUNK_SIZE,
                       )
from .util import (open_two_file,
                   )
from pretty import (reverse_pretty
def cmp(file1, file2):
    """ File comparison utility with a small chunksize """
    with open_two_file(open(file1, 'rb'), open(file2, 'rb')) as \
            (fp1, fp2):
        cmp_fp(fp1, fp2)

src/b/l/bloscpack-HEAD/bloscpack/testutil.py   bloscpack(Download)
from .defaults import (DEFAULT_CHUNK_SIZE,
                       )
from .util import (open_two_file,
                   )
from .pretty import (reverse_pretty
def cmp_file(file1, file2):
    """ File comparison utility with a small chunksize """
    with open_two_file(open(file1, 'rb'), open(file2, 'rb')) as \
            (fp1, fp2):
        cmp_fp(fp1, fp2)