aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-02-03 00:07:12 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:53 +0100
commit684e7d701a4eb21c3b95954c3ca2e38d78ee451c (patch)
treef96675497b727603268022ec0249ed80a4d93150
parent7475e79d9094b0f95758fb51721308316d667cf3 (diff)
downloadwee-slack-684e7d701a4eb21c3b95954c3ca2e38d78ee451c.tar.gz
Prefix private class methods with _
-rw-r--r--slack/slack_conversation.py4
-rw-r--r--slack/slack_workspace.py12
2 files changed, 8 insertions, 8 deletions
diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py
index f71457d..b65ad98 100644
--- a/slack/slack_conversation.py
+++ b/slack/slack_conversation.py
@@ -130,7 +130,7 @@ class SlackConversation:
short_name = self.name_prefix("short_name") + name
self.buffer_pointer = weechat.buffer_new(
- full_name, get_callback_name(self.buffer_input_cb), "", "", ""
+ full_name, get_callback_name(self._buffer_input_cb), "", "", ""
)
weechat.buffer_set(self.buffer_pointer, "short_name", short_name)
weechat.buffer_set(
@@ -165,6 +165,6 @@ class SlackConversation:
self.history_filled = True
self.history_pending = False
- def buffer_input_cb(self, data: str, buffer: str, input_data: str) -> int:
+ def _buffer_input_cb(self, data: str, buffer: str, input_data: str) -> int:
weechat.prnt(buffer, "Text: %s" % input_data)
return weechat.WEECHAT_RC_OK
diff --git a/slack/slack_workspace.py b/slack/slack_workspace.py
index aed3f18..0d7e8c9 100644
--- a/slack/slack_workspace.py
+++ b/slack/slack_workspace.py
@@ -197,7 +197,7 @@ class SlackWorkspace:
self.enterprise_id = rtm_connect["team"].get("enterprise_id")
self.my_user = await self.users[rtm_connect["self"]["id"]]
- await self.connect_ws(rtm_connect["url"])
+ await self._connect_ws(rtm_connect["url"])
users_conversations_response = await self.api.fetch_users_conversations(
"public_channel,private_channel,mpim,im"
@@ -210,7 +210,7 @@ class SlackWorkspace:
self.is_connected = True
- async def connect_ws(self, url: str):
+ async def _connect_ws(self, url: str):
proxy = Proxy()
proxy_options = {
"proxy_type": proxy.type,
@@ -231,12 +231,12 @@ class SlackWorkspace:
1,
0,
0,
- get_callback_name(self.ws_read_cb),
+ get_callback_name(self._ws_read_cb),
"",
)
self._ws.sock.setblocking(False)
- def ws_read_cb(self, data: str, fd: int) -> int:
+ def _ws_read_cb(self, data: str, fd: int) -> int:
if self._ws is None:
raise SlackError(self, "ws_read_cb called while _ws is None")
while True:
@@ -257,9 +257,9 @@ class SlackWorkspace:
elif opcode != ABNF.OPCODE_TEXT:
return weechat.WEECHAT_RC_OK
- self.ws_recv(json.loads(recv_data.decode()))
+ self._ws_recv(json.loads(recv_data.decode()))
- def ws_recv(self, data: object):
+ def _ws_recv(self, data: object):
print(f"received: {data}")
def ping(self):