pyconfs/configuration.py
def _repr_toml(value: Any) -> str:
    """Represent value as a TOML string"""

    # Use double quotes for strings
    if isinstance(value, str):
        if "\n" in value:
            # Use triple quotes for multi-line strings
            return f'"""\n{value}"""'
        else:
            return f'"{value}"'

    # Dates can be written using isoformat
    if isinstance(value, (date, datetime)):
        return value.isoformat()

    # Bools should be written true and false
    if isinstance(value, bool):
        return repr(value).lower()

    # Handle lists recursively
    if isinstance(value, (list, tuple)):
        return f"[{', '.join(_repr_toml(v) for v in value)}]"

    return str(value)
Represent value as a TOML string
Represent value as a TOML string
Represent value as a TOML string
def _repr_toml(value: Any) -> str:
    if isinstance(value, str):
        if "\n" in value:
            return f'"""\n{value}"""'
        else:
            return f'"{value}"'
    if isinstance(value, (date, datetime)):
        return value.isoformat()
    if isinstance(value, bool):
        return repr(value).lower()
    if isinstance(value, (list, tuple)):
        return f"[{', '.join(_repr_toml(v) for v in value)}]"
    return str(value)
def _repr_toml ( value : Any ) -> str : if isinstance ( value , str ) : if "\n" in value : return f'"""\n{value}"""' else : return f'"{value}"' if isinstance ( value , ( date , datetime ) ) : return value . isoformat ( ) if isinstance ( value , bool ) : return repr ( value ) . lower ( ) if isinstance ( value , ( list , tuple ) ) : return f"[{', '.join(_repr_toml(v) for v in value)}]" return str ( value )
Represent value as a TOML string
Represent value as a TOML string
"""Represent value as a TOML string""" # Use double quotes for strings # Use triple quotes for multi-line strings # Dates can be written using isoformat # Bools should be written true and false # Handle lists recursively
value
Any