aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-01-19 16:57:46 -0800
committerRyan Huber <rhuber@gmail.com>2015-01-19 16:57:46 -0800
commit6ecf30d3c1bc751551a1da6108775ff495e040b1 (patch)
tree09089aecafb2c80224ef2e87c62d3183a94cf154
parent4be162d4ad72ad8536a57d95654ee3ac0c1a64a0 (diff)
downloadwee-slack-6ecf30d3c1bc751551a1da6108775ff495e040b1.tar.gz
print connection info in server buffer
-rw-r--r--wee_slack.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index e951852..f57e401 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -242,12 +242,21 @@ class SlackServer(object):
self.connected = True
self.connecting = False
- self.buffer_prnt('Connected to {}'.format(self.domain), backlog=True)
+ self.print_connection_info(login_data)
return True
else:
w.prnt("", "\n!! slack.com login error: " + login_data["error"] + "\n Please check your API token with\n \"/set plugins.var.python.slack_extension.slack_api_token (token)\"\n\n ")
self.connected = False
+ def print_connection_info(self, login_data):
+ self.buffer_prnt('Connected to Slack', backlog=True)
+ self.buffer_prnt('{:<20} {}'.format("Websocket URL", login_data["url"]), backlog=True)
+ self.buffer_prnt('{:<20} {}'.format("User name", login_data["self"]["name"]))
+ self.buffer_prnt('{:<20} {}'.format("User ID", login_data["self"]["id"]), backlog=True)
+ self.buffer_prnt('{:<20} {}'.format("Team name", login_data["team"]["name"]), backlog=True)
+ self.buffer_prnt('{:<20} {}'.format("Team domain", login_data["team"]["domain"]), backlog=True)
+ self.buffer_prnt('{:<20} {}'.format("Team id", login_data["team"]["id"]), backlog=True)
+
def create_local_buffer(self):
if not w.buffer_search("", self.domain):
self.buffer = w.buffer_new(self.domain, "buffer_input_cb", "", "", "")