INNER CODE UNIT · Python

save_yaml

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

def save_yaml(file_path, data):
    with open(file_path, "w") as f:
        yaml_loader.dump(data, f)

def get_yaml_files():
    if not os.path.isdir(YAML_DIR):
        print(f"Directory {YAML_DIR} does not exist!")
        return []
    return [
        os.path.join(YAML_DIR, f)
        for f in os.listdir(YAML_DIR)
        if f.endswith((".yml", ".yaml")) and os.path.isfile(os.path.join(YAML_DIR, f))
    ]

# --- Type-aware value input ---
def input_value(current_value, key_name=None):
    """Get user input matching the type of current_value"""
    # Determine the type

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…