INNER CODE UNIT · Python

scan_deprecated

apistol78/traktor · scripts/generate-node-emitter-capture.py:123

def scan_deprecated():
    """Return the set of node class names tagged with the T_DEPRECATED attribute."""
    names = set()
    for pattern in NODE_HEADER_GLOBS:
        for path in glob.glob(os.path.join(ROOT, pattern)):
            with open(path, encoding="utf-8") as f:
                for line in f:
                    s = line.strip()
                    if not s.startswith("class") or "T_DEPRECATED" not in s:
                        continue
                    # Class name is the identifier just before the base-class colon,
                    # regardless of where T_DEPRECATED/T_DLLCLASS sit.
                    m = re.search(r"(\w+)\s*:", s)
                    if m and m.group(1) not in ("class",):
                        names.add(m.group(1))
    return names

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…