Also rename variables in python files

This commit is contained in:
ZyX 2014-01-30 08:46:22 +04:00
parent 79c7a006e8
commit 8096f2e8e4
2 changed files with 4 additions and 4 deletions

View File

@ -57,9 +57,9 @@ def mode(pl, segment_info, override={'vicmd': 'COMMND', 'viins': 'INSERT'}, defa
''' '''
mode = segment_info['mode'] mode = segment_info['mode']
if not mode: if not mode:
pl.debug('No or empty POWERLINE_MODE variable') pl.debug('No or empty _POWERLINE_MODE variable')
return None return None
default = default or segment_info['environ'].get('POWERLINE_DEFAULT_MODE') default = default or segment_info['environ'].get('_POWERLINE_DEFAULT_MODE')
if mode == default: if mode == default:
return None return None
try: try:
@ -68,7 +68,7 @@ def mode(pl, segment_info, override={'vicmd': 'COMMND', 'viins': 'INSERT'}, defa
# Note: with zsh line editor you can emulate as much modes as you wish. # Note: with zsh line editor you can emulate as much modes as you wish.
# Thus having unknown mode is not an error: maybe just some developer # Thus having unknown mode is not an error: maybe just some developer
# added support for his own zle widgets. As there is no built-in mode() # added support for his own zle widgets. As there is no built-in mode()
# function like in VimL and POWERLINE_MODE is likely be defined by our # function like in VimL and _POWERLINE_MODE is likely be defined by our
# code or by somebody knowing what he is doing there is absolutely no # code or by somebody knowing what he is doing there is absolutely no
# need in keeping translations dictionary. # need in keeping translations dictionary.
return mode.upper() return mode.upper()

View File

@ -22,7 +22,7 @@ if __name__ == '__main__':
width=args.width, width=args.width,
side=args.side, side=args.side,
segment_info=segment_info, segment_info=segment_info,
mode=os.environ.get('POWERLINE_MODE'), mode=os.environ.get('_POWERLINE_MODE'),
) )
try: try:
sys.stdout.write(rendered) sys.stdout.write(rendered)