aboutsummaryrefslogtreecommitdiffstats
path: root/extract_token_from_browser.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2022-03-19 15:18:39 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2022-09-18 16:36:55 +0200
commitf205c37dc9e43e7c159a5d36a1b11b78365492ea (patch)
treeb921f442ccb8b25c274407d4b31a677af5623c25 /extract_token_from_browser.py
parentd643f5d0fd106a19b273f187f6f3f08ecb3f28d6 (diff)
downloadwee-slack-f205c37dc9e43e7c159a5d36a1b11b78365492ea.tar.gz
Improve output format for extract_token_from_browser.py
Diffstat (limited to 'extract_token_from_browser.py')
-rwxr-xr-xextract_token_from_browser.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/extract_token_from_browser.py b/extract_token_from_browser.py
index 7a9f09d..d571120 100755
--- a/extract_token_from_browser.py
+++ b/extract_token_from_browser.py
@@ -45,7 +45,11 @@ local_config_str = con.execute(local_storage_query).fetchone()[0]
con.close()
local_config = json.loads(local_config_str)
-
-for team in local_config["teams"].values():
- if not team["id"].startswith("E"):
- print(f"{team['name']}: /slack register {team['token']}:{cookie_d_value}")
+teams = [
+ team for team in local_config["teams"].values() if not team["id"].startswith("E")
+]
+register_commands = [
+ f"{team['name']}:\n/slack register {team['token']}:{cookie_d_value}"
+ for team in teams
+]
+print("\n\n".join(register_commands))