tools/fix_b2g_stack.py
def pump(dst, src):
    '''Pump the file dst into the file src.  When src hits EOF, close dst.

    Returns a thread object, so you can e.g. join() on the result.

    '''
    class Pumper(threading.Thread):
        def run(self):
            while True:
                bytes = src.read(4096)
                if not bytes:
                    break
                dst.write(bytes)
            dst.close()
    p = Pumper()
    p.start()
    return p
Pump the file dst into the file src.  When src hits EOF, close dst.

    Returns a thread object, so you can e.g. join() on the result.

    
Pump the file dst into the file src.  When src hits EOF, close dst.
Returns a thread object, so you can e.g. join() on the result.
Pump the file dst into the file src . When src hits EOF close dst . Returns a thread object so you can e . g . join () on the result .
def pump(dst, src):
    class Pumper(threading.Thread):
        def run(self):
            while True:
                bytes = src.read(4096)
                if not bytes:
                    break
                dst.write(bytes)
            dst.close()
    p = Pumper()
    p.start()
    return p
def pump ( dst , src ) : class Pumper ( threading . Thread ) : def run ( self ) : while True : bytes = src . read ( 4096 ) if not bytes : break dst . write ( bytes ) dst . close ( ) p = Pumper ( ) p . start ( ) return p
Pump the file dst into the file src.
Pump the file dst into the file src .
'''Pump the file dst into the file src.  When src hits EOF, close dst.

    Returns a thread object, so you can e.g. join() on the result.

    '''
dst
src