Example #1
0
 def parse_config(lines: Iterable[str]) -> Dict[str, Any]:
     ans: Dict[str, Any] = create_result_dict()
     parse_config_base(
         lines,
         parse_conf_item,
         ans,
     )
     return ans
Example #2
0
File: config.py Project: yert/kitty
def parse_config(lines, check_keys=True):
    ans = {'key_definitions': {}}
    parse_config_base(lines,
                      defaults,
                      type_convert,
                      special_handling,
                      ans,
                      check_keys=check_keys)
    return ans
Example #3
0
 def parse_config(lines: List[str],
                  check_keys: bool = True) -> OptionValues:
     result = {'key_definitions': {}}  # type: OptionValues
     parse_config_base(lines,
                       defaults,
                       type_map,
                       special_handling,
                       result,
                       check_keys=check_keys)
     return result
Example #4
0
def parse_config(lines: Iterable[str],
                 check_keys: bool = True) -> Dict[str, Any]:
    ans: Dict[str, Any] = {'key_definitions': {}}
    parse_config_base(lines,
                      defaults,
                      type_convert,
                      special_handling,
                      ans,
                      check_keys=check_keys)
    return ans
Example #5
0
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,
        defs,
        all_options,
        special_handling,
        ans,
    )
    return ans