aboutsummaryrefslogtreecommitdiffstats
path: root/ssh.py
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-09-17 12:40:07 -0400
committerJesse Luehrs <doy@tozt.net>2014-09-17 12:40:07 -0400
commit95d3a2ef4001473aa382eafea2ed00a066973c11 (patch)
treec82ce766bb9334ef94ce9fbb1e96f84aef081f1c /ssh.py
parent92ba955c9cb5836c21d15537f9cccc91a999bc53 (diff)
downloadpython-termcast-server-95d3a2ef4001473aa382eafea2ed00a066973c11.tar.gz
python-termcast-server-95d3a2ef4001473aa382eafea2ed00a066973c11.zip
report the number of viewers in the selection menu
Diffstat (limited to 'ssh.py')
-rw-r--r--ssh.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ssh.py b/ssh.py
index 23d84dd..352fedd 100644
--- a/ssh.py
+++ b/ssh.py
@@ -98,8 +98,8 @@ class Connection(object):
def _display_streamer_screen(self, streamers):
self.chan.send("\033[H\033[2JWelcome to Termcast!")
self.chan.send(
- "\033[3H %-20s %-15s %-15s %-15s" % (
- "User", "Terminal size", "Idle time", "Total time"
+ "\033[3H %-20s %-15s %-10s %-15s %-15s" % (
+ "User", "Terminal size", "Viewers", "Idle time", "Total time"
)
)
row = 4
@@ -112,11 +112,13 @@ class Connection(object):
if streamer["cols"] > self.server.cols or streamer["rows"] > self.server.rows:
size_pre = "\033[31m"
size_post = "\033[m"
+ viewers = streamer["viewers"]
idle = streamer["idle_time"]
total = streamer["total_time"]
self.chan.send(
- "\033[%dH%s) %-20s %s%-15s%s %-15s %-15s" % (
- row, key, name, size_pre, size, size_post, idle, total
+ "\033[%dH%s) %-20s %s%-15s%s %-10s %-15s %-15s" % (
+ row, key, name, size_pre, size, size_post,
+ viewers, idle, total
)
)
row += 1