Skip to content
Snippets Groups Projects
Commit 053847c5 authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Implement KeyboardInterrupt for --watch

parent bc4d2d31
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import os, sys
import time
import json
import click
......@@ -101,11 +101,14 @@ def meetings(ctx, userconfig, watch, short, compact, n, all_, twolines, leaderbo
config.filter_endpoints(endpoint)
if watch is not None:
while watch is not None:
try:
if twolines:
meetings_twolines(config, watch, fancy, sum_)
else:
list_meetings(config, leaderboards, n, participants, presenter, presenter_id, meetings, watch, fancy, compact, sum_)
time.sleep(watch)
except KeyboardInterrupt:
sys.exit()
else:
if twolines:
meetings_twolines(config, watch, fancy, sum_)
......@@ -165,8 +168,11 @@ def json(ctx, userconfig, watch, endpoint, compact):
exit()
if watch is not None:
while watch is not None:
try:
print(format_json(config, watch, compact))
time.sleep(watch)
except KeyboardInterrupt:
sys.exit()
else:
print(format_json(config, watch, compact))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment