Merge remote-tracking branch 'zyx-i/powerline-list-expanduser' into develop

This commit is contained in:
Kim Silkebækken 2013-06-28 13:36:38 +02:00
commit bb6c959313
1 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,5 @@
# vim:fileencoding=utf-8:noet
from powerline.lint.markedjson import load
from powerline import find_config_file, Powerline
from powerline.lib.config import load_json_config
@ -436,9 +438,9 @@ main_spec = (Spec(
term_truecolor=Spec().type(bool).optional(),
# Python is capable of loading from zip archives. Thus checking path
# only for existence of the path, not for it being a directory
paths=Spec().list((lambda value, *args: (True, True, not os.path.exists(value.value))),
paths=Spec().list((lambda value, *args: (True, True, not os.path.exists(os.path.expanduser(value.value)))),
lambda value: 'path does not exist: {0}'.format(value)).optional(),
log_file=Spec().type(str).func(lambda value, *args: (True, True, not os.path.isdir(os.path.dirname(value))),
log_file=Spec().type(str).func(lambda value, *args: (True, True, not os.path.isdir(os.path.dirname(os.path.expanduser(value)))),
lambda value: 'directory does not exist: {0}'.format(os.path.dirname(value))).optional(),
log_level=Spec().re('^[A-Z]+$').func(lambda value, *args: (True, True, not hasattr(logging, value)),
lambda value: 'unknown debugging level {0}'.format(value)).optional(),