bumblebee-status/bumblebee/outputs/i3.py
Tobias Witek c4683f3700 [output] Create preliminary framework for output handling
Prepare a framework for having modular outputs. Essentially, the main
application uses a output-type object to format strings for the
preamble, the actual data items, and a "postamble" (finalizer). The
printing of that representation, again, is up to the main application,
not the output framework.

Probably, at some point in the future, an interface class will be in
order, but right now, I want to keep it lean - seeing as for the
forseeable future, i3bar is going to be the one and only consumer of
this.
2016-10-30 15:58:35 +01:00

13 lines
264 B
Python

import json
class i3bar:
def preamble(self):
return json.dumps({ "version": 1 }) + "["
def data(self, data):
return json.dumps(data) + ","
def finalize(self):
return "]"
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4