示例#1
0
文件: worker.py 项目: pdiazs/calibre
def main(control_conn, data_conn):
    from calibre.gui2.tweak_book.completion.basic import handle_control_request
    while True:
        try:
            request = eintr_retry_call(control_conn.recv)
        except EOFError:
            break
        if request is None:
            break
        try:
            ans, tb = handle_control_request(request, data_conn), None
        except Exception:
            import traceback
            ans, tb = None, traceback.format_exc()
        result = Result(request.id, ans, tb)
        try:
            eintr_retry_call(control_conn.send, result)
        except EOFError:
            break
示例#2
0
文件: worker.py 项目: SAB2012/calibre
def main(control_conn, data_conn):
    from calibre.gui2.tweak_book.completion.basic import handle_control_request
    while True:
        try:
            request = eintr_retry_call(control_conn.recv)
        except EOFError:
            break
        if request is None:
            break
        try:
            ans, tb = handle_control_request(request, data_conn), None
        except Exception:
            import traceback
            ans, tb = None, traceback.format_exc()
        if request.id is not None:
            result = Result(request.id, ans, tb)
            try:
                eintr_retry_call(control_conn.send, result)
            except EOFError:
                break
示例#3
0
def main(control_conn, data_conn):
    from calibre.gui2.tweak_book.completion.basic import handle_control_request
    while True:
        try:
            request = eintr_retry_call(control_conn.recv)
        except (KeyboardInterrupt, EOFError):
            break
        if request is None:
            break
        try:
            ans, tb = handle_control_request(request, data_conn), None
        except DataError as err:
            ans, tb = None, err.traceback()
        except Exception:
            import traceback
            ans, tb = None, traceback.format_exc()
        if request.id is not None:
            result = Result(request.id, ans, tb, request.query)
            try:
                eintr_retry_call(control_conn.send, result)
            except EOFError:
                break