#!/usr/bin/env python # vim:fileencoding=utf-8:noet '''Powerline prompt and statusline script.''' import sys import os try: from powerline.shell import ShellPowerline, get_argparser, finish_args, write_output except ImportError: sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(os.path.realpath(__file__))))) from powerline.shell import ShellPowerline, get_argparser, finish_args, write_output # NOQA def write(output): try: sys.stdout.write(output) except UnicodeEncodeError: sys.stdout.write(output.encode('utf-8')) if __name__ == '__main__': args = get_argparser(description=__doc__).parse_args() finish_args(args) powerline = ShellPowerline(args, run_once=True) segment_info = {'args': args, 'environ': os.environ} write_output(args, powerline, segment_info, write)