Use init_context to initialize config context
This commit is contained in:
parent
b5fae89d6c
commit
721dadd57c
|
@ -37,6 +37,10 @@ key_sep = JStr('/')
|
||||||
list_sep = JStr(', ')
|
list_sep = JStr(', ')
|
||||||
|
|
||||||
|
|
||||||
|
def init_context(config):
|
||||||
|
return ((MarkedUnicode('', config.mark), config),)
|
||||||
|
|
||||||
|
|
||||||
def context_key(context):
|
def context_key(context):
|
||||||
return key_sep.join((c[0] for c in context))
|
return key_sep.join((c[0] for c in context))
|
||||||
|
|
||||||
|
@ -1474,7 +1478,7 @@ def check(paths=None, debug=False):
|
||||||
if main_spec.match(
|
if main_spec.match(
|
||||||
main_config,
|
main_config,
|
||||||
data={'configs': configs, 'lists': lists},
|
data={'configs': configs, 'lists': lists},
|
||||||
context=(('', main_config),),
|
context=init_context(main_config),
|
||||||
echoerr=ee
|
echoerr=ee
|
||||||
)[1]:
|
)[1]:
|
||||||
hadproblem = True
|
hadproblem = True
|
||||||
|
@ -1492,7 +1496,7 @@ def check(paths=None, debug=False):
|
||||||
sys.stderr.write(str(e) + '\n')
|
sys.stderr.write(str(e) + '\n')
|
||||||
hadproblem = True
|
hadproblem = True
|
||||||
else:
|
else:
|
||||||
if colors_spec.match(colors_config, context=(('', colors_config),), echoerr=ee)[1]:
|
if colors_spec.match(colors_config, context=init_context(colors_config), echoerr=ee)[1]:
|
||||||
hadproblem = True
|
hadproblem = True
|
||||||
|
|
||||||
if lhadproblem[0]:
|
if lhadproblem[0]:
|
||||||
|
@ -1517,7 +1521,7 @@ def check(paths=None, debug=False):
|
||||||
hadproblem = True
|
hadproblem = True
|
||||||
top_colorscheme_configs[colorscheme] = config
|
top_colorscheme_configs[colorscheme] = config
|
||||||
data['colorscheme'] = colorscheme
|
data['colorscheme'] = colorscheme
|
||||||
if top_colorscheme_spec.match(config, context=(('', config),), data=data, echoerr=ee)[1]:
|
if top_colorscheme_spec.match(config, context=init_context(config), data=data, echoerr=ee)[1]:
|
||||||
hadproblem = True
|
hadproblem = True
|
||||||
|
|
||||||
ext_colorscheme_configs = defaultdict(lambda: {})
|
ext_colorscheme_configs = defaultdict(lambda: {})
|
||||||
|
@ -1549,7 +1553,7 @@ def check(paths=None, debug=False):
|
||||||
spec = shell_colorscheme_spec
|
spec = shell_colorscheme_spec
|
||||||
else:
|
else:
|
||||||
spec = colorscheme_spec
|
spec = colorscheme_spec
|
||||||
if spec.match(config, context=(('', config),), data=data, echoerr=ee)[1]:
|
if spec.match(config, context=init_context(config), data=data, echoerr=ee)[1]:
|
||||||
hadproblem = True
|
hadproblem = True
|
||||||
|
|
||||||
colorscheme_configs = {}
|
colorscheme_configs = {}
|
||||||
|
@ -1618,7 +1622,7 @@ def check(paths=None, debug=False):
|
||||||
else:
|
else:
|
||||||
data['theme_type'] = 'regular'
|
data['theme_type'] = 'regular'
|
||||||
spec = theme_spec
|
spec = theme_spec
|
||||||
if spec.match(config, context=(('', config),), data=data, echoerr=ee)[1]:
|
if spec.match(config, context=init_context(config), data=data, echoerr=ee)[1]:
|
||||||
hadproblem = True
|
hadproblem = True
|
||||||
|
|
||||||
for top_theme, config in top_theme_configs.items():
|
for top_theme, config in top_theme_configs.items():
|
||||||
|
@ -1633,7 +1637,7 @@ def check(paths=None, debug=False):
|
||||||
}
|
}
|
||||||
data['theme_type'] = 'top'
|
data['theme_type'] = 'top'
|
||||||
data['theme'] = top_theme
|
data['theme'] = top_theme
|
||||||
if top_theme_spec.match(config, context=(('', config),), data=data, echoerr=ee)[1]:
|
if top_theme_spec.match(config, context=init_context(config), data=data, echoerr=ee)[1]:
|
||||||
hadproblem = True
|
hadproblem = True
|
||||||
|
|
||||||
return hadproblem
|
return hadproblem
|
||||||
|
|
Loading…
Reference in New Issue