aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2022-09-19 18:00:17 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2022-09-19 18:00:17 +0200
commiteb73a50abf8514eef85161825b8a14c788939715 (patch)
treecb9588ecccc102faaa6ab2bde7518d410218b2ff /wee_slack.py
parent4b946d8bfa4173113a2bad0f402ff4fd4490919f (diff)
downloadwee-slack-eb73a50abf8514eef85161825b8a14c788939715.tar.gz
Fix compatibility with Python 2
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 9ecfc94..a0c9d89 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1599,7 +1599,7 @@ class SlackTeam(object):
users,
bots,
channels,
- **kwargs,
+ **kwargs
):
self.slack_api_translator = copy.deepcopy(SLACK_API_TRANSLATOR)
self.identifier = team_info["id"]
@@ -4198,12 +4198,10 @@ def download_files(message_json, channel):
if os.path.isfile(fileout):
continue
curl_options = SlackRequest(channel.team, "").options()
+ curl_options["file_out"] = fileout
w.hook_process_hashtable(
"url:" + f["url_private"],
- {
- **curl_options,
- "file_out": fileout,
- },
+ curl_options,
config.slack_timeout,
"",
"",
@@ -6844,11 +6842,11 @@ def initiate_connection(token):
w.prnt(
"",
"You are a restricted user in this team, "
- f"{data_type} not loaded",
+ "{} not loaded".format(data_type),
)
else:
initial_data["errors"].append(
- f'{data_type}: {response_json["error"]}'
+ "{}: {}".format(data_type, response_json["error"])
)
initial_data["remaining"][data_type] -= 1
create_team(token, initial_data)
@@ -6864,7 +6862,7 @@ def initiate_connection(token):
def handle_prefs(response_json, eventrouter, team, channel, metadata):
if not response_json["ok"]:
- initial_data["errors"].append(f'prefs: {response_json["error"]}')
+ initial_data["errors"].append("prefs: {}".format(response_json["error"]))
initial_data["remaining"]["prefs"] -= 1
create_team(token, initial_data)
return
@@ -6875,7 +6873,7 @@ def initiate_connection(token):
def handle_getPresence(response_json, eventrouter, team, channel, metadata):
if not response_json["ok"]:
- initial_data["errors"].append(f'presence: {response_json["error"]}')
+ initial_data["errors"].append("presence: {}".format(response_json["error"]))
initial_data["remaining"]["presence"] -= 1
create_team(token, initial_data)
return