示例#1
0
def handle_payload(api, payload):
    (modules, handlers) = eventhandler.get_handlers()
    for handler in handlers:
        handler.handle_payload(api, payload)
    warnings = eventhandler.get_warnings()
    if warnings:
        api.post_comment(warning_summary % '\n'.join(map(lambda x: '* ' + x, warnings)))
示例#2
0
文件: newpr.py 项目: zwn/highfive
def handle_payload(api, payload):
    (modules, handlers) = eventhandler.get_handlers()
    for handler in handlers:
        handler.handle_payload(api, payload)
    warnings = eventhandler.get_warnings()
    if warnings:
        api.post_comment(warning_summary %
                         '\n'.join(map(lambda x: '* ' + x, warnings)))
示例#3
0
def handle_payload(api, payload, handlers=None):
    if not handlers:
        modules, handlers = eventhandler.get_handlers()
    for handler in handlers:
        handler.handle_payload(api, payload)
    warnings = eventhandler.get_warnings()
    if warnings:
        formatted_warnings = '\n'.join(map(lambda x: '* ' + x, warnings))
        api.post_comment(warning_summary % formatted_warnings)
示例#4
0
def handle_payload(api, payload):
    (modules, handlers) = eventhandler.get_handlers()

    if payload["action"] == "opened":
        for handler in handlers:
            handler.on_pr_opened(api, payload)
    elif payload["action"] == "synchronize":
        for handler in handlers:
            handler.on_pr_updated(api, payload)
    elif payload["action"] == "created":
        for handler in handlers:
            handler.on_new_comment(api, payload)
    else:
        pass

    warnings = eventhandler.get_warnings()
    if warnings:
        api.post_comment(warning_summary % '\n'.join(map(lambda x: '* ' + x, warnings)))