def print_event_stream():
"""Print event stream"""
controllers = discover()
# for now only care about one controller
controller = next(controllers, None) or exit('no tellstick devices found')
if argv[-1] == "raw":
stream = map(prepend_timestamp, controller.packets())
else:
stream = controller.events()
for packet in stream:
print(packet)
try:
stdout.flush()
except IOError:
# broken pipe
pass
评论列表
文章目录