def process_result(method, result):
    """Process given C{B{result}} based on flags set in C{B{method}}

    @param method: L{Method} instance
    @type method: Method

    @param result: result to be processed (the result of given L{Method} instance)

    @note: Supported Processing:
        - boolean - convert ones and zeros returned by rTorrent and
        convert to python boolean values
    """
    # handle custom post processing function
    if method.post_process_func is not None:
        result = method.post_process_func(result)

    # is boolean?
    if method.boolean:
        if result in [1, '1']:
            result = True
        elif result in [0, '0']:
            result = False

    return result