Do not use os.environ for write_output

This is required for daemon to work properly
This commit is contained in:
ZyX 2014-08-10 14:51:38 +04:00
parent e64811c661
commit 8de14c1fd7
1 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,5 @@
# vim:fileencoding=utf-8:noet
import os
from powerline import Powerline
from powerline.lib import mergedicts, parsedotval
@ -82,7 +80,7 @@ def write_output(args, powerline, segment_info, write):
for line in powerline.render_above_lines(
width=args.width,
segment_info=segment_info,
mode=os.environ.get('_POWERLINE_MODE'),
mode=segment_info['environ'].get('_POWERLINE_MODE'),
):
write(line)
write('\n')
@ -93,6 +91,6 @@ def write_output(args, powerline, segment_info, write):
width=args.width,
side=args.side,
segment_info=segment_info,
mode=os.environ.get('_POWERLINE_MODE'),
mode=segment_info['environ'].get('_POWERLINE_MODE'),
)
write(rendered)