pyconfs/writers/ini.py
def _normalize(config: Dict[str, Any], store_types: bool) -> Dict[str, Dict[str, str]]:
    """ConfigParser only supports string values and 1 level of nesting"""
    if store_types:
        raise NotImplementedError("Handling of types is not implemented in ini-writer")

    normalized = {}
    for section_name, section in config.items():
        if isinstance(section, dict):
            norm_section = normalized.setdefault(section_name, {})
            for key, entry in section.items():
                norm_section.update(_as_str(key, entry))
        elif isinstance(section, list):
            raise NotImplementedError(
                "Ini-writer does not handle top-level list configurations"
            )
        else:
            # Add section around top-level items
            normalized[section_name] = {section_name: str(section)}

    return normalized
ConfigParser only supports string values and 1 level of nesting
ConfigParser only supports string values and 1 level of nesting
ConfigParser only supports string values and 1 level of nesting
def _normalize(config: Dict[str, Any], store_types: bool) -> Dict[str, Dict[str, str]]:
    if store_types:
        raise NotImplementedError("Handling of types is not implemented in ini-writer")
    normalized = {}
    for section_name, section in config.items():
        if isinstance(section, dict):
            norm_section = normalized.setdefault(section_name, {})
            for key, entry in section.items():
                norm_section.update(_as_str(key, entry))
        elif isinstance(section, list):
            raise NotImplementedError(
                "Ini-writer does not handle top-level list configurations"
            )
        else:
            normalized[section_name] = {section_name: str(section)}
    return normalized
def _normalize ( config : Dict [ str , Any ] , store_types : bool ) -> Dict [ str , Dict [ str , str ] ] : if store_types : raise NotImplementedError ( "Handling of types is not implemented in ini-writer" ) normalized = { } for section_name , section in config . items ( ) : if isinstance ( section , dict ) : norm_section = normalized . setdefault ( section_name , { } ) for key , entry in section . items ( ) : norm_section . update ( _as_str ( key , entry ) ) elif isinstance ( section , list ) : raise NotImplementedError ( "Ini-writer does not handle top-level list configurations" ) else : normalized [ section_name ] = { section_name : str ( section ) } return normalized
ConfigParser only supports string values and 1 level of nesting
ConfigParser only supports string values and 1 level of nesting
"""ConfigParser only supports string values and 1 level of nesting""" # Add section around top-level items
config
Dict[str, Any]
store_types
bool