Make scripts/powerline use os.environ['PWD'] for .getcwd() if present

Closes #330
This commit is contained in:
ZyX 2013-03-23 19:03:43 +04:00
parent 8a51d99389
commit 7370876c35
1 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,10 @@ except ImportError:
if __name__ == '__main__':
args = get_argparser(description=__doc__).parse_args()
powerline = ShellPowerline(args, run_once=True)
kwargs = {}
if 'PWD' in os.environ:
kwargs['getcwd'] = lambda: os.environ['PWD']
powerline = ShellPowerline(args, run_once=True, **kwargs)
rendered = powerline.renderer.render(width=args.width, side=args.side, segment_info=args)
try:
sys.stdout.write(rendered)