INNER CODE UNIT · Python

should_export_domain

magicsword-io/LOLRMM · bin/generate_domains_csv.py:33

def should_export_domain(domain):
    """Return True when a Domains value is a real CSV lookup candidate."""
    if not isinstance(domain, str):
        return False

    value = domain.strip()
    return bool(value) and value not in SENTINEL_VALUES and not PLACEHOLDER_RE.match(value)


def extract_domains(yaml_file_path):
    """Extract domains from a YAML file."""
    try:
        print(f"Processing file: {yaml_file_path}")
        with open(yaml_file_path, "r", encoding="utf-8") as file:
            data = yaml.safe_load(file)

        # Get the tool name from the YAML Name field if available, otherwise use filename
        tool_name = data.get("Name", clean_tool_name(yaml_file_path))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…