INNER CODE UNIT · Python

input_value

ahembree/ansible-hms-docker · settings_manager.py:36

def input_value(current_value, key_name=None):
    """Get user input matching the type of current_value"""
    # Determine the type
    if current_value is None:
        val_type = str
    elif isinstance(current_value, bool):
        val_type = bool
    elif isinstance(current_value, int):
        val_type = int
    elif isinstance(current_value, float):
        val_type = float
    elif isinstance(current_value, (list, CommentedSeq)):
        val_type = list
    elif isinstance(current_value, (dict, CommentedMap)):
        val_type = dict
    else:
        # String - check if it's a string representation of bool
        if isinstance(current_value, str) and current_value.lower() in ("yes", "no", "true", "false"):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…