powerline/scripts/powerline-render

31 lines
892 B
Plaintext
Raw Normal View History

#!/usr/bin/env python
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import os
2012-11-26 16:16:39 +01:00
try:
from powerline.shell import ShellPowerline
except ImportError:
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(os.path.realpath(__file__)))))
from powerline.shell import ShellPowerline
from powerline.commands.main import get_argparser, finish_args, write_output
from powerline.lib.unicode import get_preferred_output_encoding
2013-01-10 19:55:18 +01:00
if sys.version_info < (3,):
write = sys.stdout.write
else:
write = sys.stdout.buffer.write
2013-01-10 19:55:18 +01:00
if __name__ == '__main__':
args = get_argparser().parse_args()
finish_args(os.environ, args)
2013-03-31 22:01:51 +02:00
powerline = ShellPowerline(args, run_once=True)
2013-05-06 17:13:31 +02:00
segment_info = {'args': args, 'environ': os.environ}
write_output(args, powerline, segment_info, write, get_preferred_output_encoding())