S15qkd/chopper.py
def _t2logpipe_digest():
    '''Digests chopper activities.

    Watches t2logpipe for new epoch files and writes the epoch name into the transferd cmdpipe.
    Transferd copies the corresponding epoch file to the partnering computer.
    '''
    global t2logpipe_digest_thread_flag
    t2logpipe_digest_thread_flag = True
    fd = os.open(PipesQKD.T2LOG, os.O_RDONLY | os.O_NONBLOCK)
    f = os.fdopen(fd, 'rb', 0)  # non-blocking

    while t2logpipe_digest_thread_flag is True:
        time.sleep(0.1)
        try:
            message = (f.readline().decode().rstrip('\n')).lstrip('\x00')
            if len(message) == 0:
                continue
            epoch = message.split()[0]
            qkd_globals.writer(PipesQKD.CMD, epoch)
            logger.debug(f'Msg: {message}')
        except OSError:
            pass
    logger.info(f'Thread finished')
Digests chopper activities.

    Watches t2logpipe for new epoch files and writes the epoch name into the transferd cmdpipe.
    Transferd copies the corresponding epoch file to the partnering computer.
    
Digests chopper activities.
Watches t2logpipe for new epoch files and writes the epoch name into the transferd cmdpipe.
Transferd copies the corresponding epoch file to the partnering computer.
Digests chopper activities . Watches t2logpipe for new epoch files and writes the epoch name into the transferd cmdpipe . Transferd copies the corresponding epoch file to the partnering computer .
def _t2logpipe_digest():
    global t2logpipe_digest_thread_flag
    t2logpipe_digest_thread_flag = True
    fd = os.open(PipesQKD.T2LOG, os.O_RDONLY | os.O_NONBLOCK)
    f = os.fdopen(fd, 'rb', 0)  
    while t2logpipe_digest_thread_flag is True:
        time.sleep(0.1)
        try:
            message = (f.readline().decode().rstrip('\n')).lstrip('\x00')
            if len(message) == 0:
                continue
            epoch = message.split()[0]
            qkd_globals.writer(PipesQKD.CMD, epoch)
            logger.debug(f'Msg: {message}')
        except OSError:
            pass
    logger.info(f'Thread finished')
def _t2logpipe_digest ( ) : global t2logpipe_digest_thread_flag t2logpipe_digest_thread_flag = True fd = os . open ( PipesQKD . T2LOG , os . O_RDONLY | os . O_NONBLOCK ) f = os . fdopen ( fd , 'rb' , 0 ) while t2logpipe_digest_thread_flag is True : time . sleep ( 0.1 ) try : message = ( f . readline ( ) . decode ( ) . rstrip ( '\n' ) ) . lstrip ( '\x00' ) if len ( message ) == 0 : continue epoch = message . split ( ) [ 0 ] qkd_globals . writer ( PipesQKD . CMD , epoch ) logger . debug ( f'Msg: {message}' ) except OSError : pass logger . info ( f'Thread finished' )
Digests chopper activities.
Digests chopper activities .
'''Digests chopper activities.

    Watches t2logpipe for new epoch files and writes the epoch name into the transferd cmdpipe.
    Transferd copies the corresponding epoch file to the partnering computer.
    ''' # non-blocking