mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
The parser doesnt need the full defaults object
This commit is contained in:
parent
c1777b1098
commit
3b1d534f6d
3 changed files with 11 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
|||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import os
|
||||
from typing import Any, Dict, Iterable, Optional, Tuple, Type, Union
|
||||
from typing import Any, Dict, FrozenSet, Iterable, Optional, Tuple, Type, Union
|
||||
|
||||
from kitty.cli_stub import DiffCLIOptions
|
||||
from kitty.conf.definition import config_lines
|
||||
|
|
@ -93,13 +93,16 @@ def special_handling(key: str, val: str, ans: Dict) -> bool:
|
|||
|
||||
def parse_config(lines: Iterable[str], check_keys: bool = True) -> Dict[str, Any]:
|
||||
ans: Dict[str, Any] = {'key_definitions': {}}
|
||||
defs: Optional[FrozenSet] = None
|
||||
if check_keys:
|
||||
defs = frozenset(defaults._fields) # type: ignore
|
||||
|
||||
parse_config_base(
|
||||
lines,
|
||||
defaults,
|
||||
defs,
|
||||
all_options,
|
||||
special_handling,
|
||||
ans,
|
||||
check_keys=check_keys
|
||||
)
|
||||
return ans
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue