File: powerline-render

package info (click to toggle)
powerline 2.7-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,828 kB
  • sloc: python: 22,536; sh: 1,789; ansic: 131; makefile: 74; csh: 51
file content (31 lines) | stat: -rwxr-xr-x 886 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python3
# vim:fileencoding=utf-8:noet

from __future__ import (unicode_literals, division, absolute_import, print_function)

import sys
import os

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.encoding import get_unicode_writer


if sys.version_info < (3,):
	write = sys.stdout.write
else:
	write = sys.stdout.buffer.write


if __name__ == '__main__':
	parser = get_argparser()
	args = parser.parse_args()
	finish_args(parser, os.environ, args)
	powerline = ShellPowerline(args, run_once=True)
	segment_info = {'args': args, 'environ': os.environ}
	write_output(args, powerline, segment_info, get_unicode_writer())