~stacyharper/wee-matter

c59c6da8ef3deed71b6555096ec89b36895ee412 — Stacy Harper 15 days ago 619d51f
Rename method to a more generic name
2 files changed, 17 insertions(+), 17 deletions(-)

M main.py
M wee_matter/http.py
M main.py => main.py +1 -1
@@ 15,7 15,7 @@ from wee_matter.commands import (matter_command_cb, reply_command_cb,
from wee_matter.websocket import (receive_ws_callback, ws_ping_cb,
                                  reconnection_loop_cb)

from wee_matter.http import (singularity_cb, buffered_response_cb,
from wee_matter.http import (singularity_cb, http_response_cb,
                            handle_queued_request_cb)

from wee_matter.config import (config_reload_cb, server_section_write_default_cb,

M wee_matter/http.py => wee_matter/http.py +16 -16
@@ 31,7 31,7 @@ def singularity_cb(data, command, rc, out, err):

    return weechat.WEECHAT_RC_OK

def buffered_response_cb(data, command, rc, out, err):
def http_response_cb(data, command, rc, out, err):
    arg_search = re.search('([^\|]*)\|([^\|]*)\|(.*)', data)
    if not arg_search:
        weechat.prnt("", "Bad usage of buffered response cb \"{}\"".format(data))


@@ 81,7 81,7 @@ def run_get_user_teams(user_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 94,7 94,7 @@ def run_get_team(team_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 107,7 107,7 @@ def run_get_users(server, page, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 120,7 120,7 @@ def run_get_user(server, user_id, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 137,7 137,7 @@ def run_user_logout(server, cb, cb_data):
            ]),
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 156,7 156,7 @@ def run_user_login(server, cb, cb_data):
            "header": "1",
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 169,7 169,7 @@ def run_get_channel(channel_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 182,7 182,7 @@ def run_get_user_team_channels(user_id, team_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 204,7 204,7 @@ def run_post_post(post, server, cb, cb_data):
            "postfields": json.dumps(params),
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 223,7 223,7 @@ def run_post_command(channel_id, command, server, cb, cb_data):
            "postfields": json.dumps(params),
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 236,7 236,7 @@ def run_get_channel_posts(channel_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 249,7 249,7 @@ def run_get_read_channel_posts(user_id, channel_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 262,7 262,7 @@ def run_get_channel_posts_after(post_id, channel_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 275,7 275,7 @@ def run_get_channel_members(channel_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )



@@ 288,7 288,7 @@ def run_get_channel_member(channel_id, member_id, server, cb, cb_data):
            "httpheader": "Authorization: Bearer " + server.user_token,
        },
        30 * 1000,
        "buffered_response_cb",
        "http_response_cb",
        build_buffer_cb_data(url, cb, cb_data)
    )