'Updates progress information'

@classmethod
def handle_cursor(cls, cursor, query, session):

    logging.info(u'Polling    the    cursor    for    progress')
    polled = cursor.poll()
    while polled:
        stats = polled.get(u'stats', {})
        query = session.query(type(query)).filter_by(id=query.id).one()
        if (query.status == QueryStatus.STOPPED):
            cursor.cancel()
            break
        if stats:
            completed_splits = float(stats.get(u'completedSplits'))
            total_splits = float(stats.get(u'totalSplits'))
            if (total_splits and completed_splits):
                progress = (100 * (completed_splits / total_splits))
                logging.info(u'Query    progress:    {}    /    {}    splits'.format(completed_splits, total_splits))
                if (progress > query.progress):
                    query.progress = progress
                session.commit()
        time.sleep(1)
        logging.info(u'Polling    the    cursor    for    progress')
        polled = cursor.poll()
