6f52825ef0
Add output handler for i3bar protocol and add some tests for it. Right now, it only support start and end. see #23
21 lines
494 B
Python
21 lines
494 B
Python
# pylint: disable=R0201
|
|
|
|
"""Output classes"""
|
|
|
|
import sys
|
|
import json
|
|
|
|
class I3BarOutput(object):
|
|
"""Manage output according to the i3bar protocol"""
|
|
def __init__(self):
|
|
pass
|
|
|
|
def start(self):
|
|
"""Print start preamble for i3bar protocol"""
|
|
sys.stdout.write(json.dumps({"version": 1, "click_events": True}) + "[\n")
|
|
|
|
def stop(self):
|
|
"""Finish i3bar protocol"""
|
|
sys.stdout.write("]\n")
|
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|