INNER CODE UNIT · Python

build_field_list

Zverik/every_door · tools/json_to_sqlite.py:294

    def build_field_list(data: dict[str, dict], name: str, column: str) -> list[str]:
        if name not in data:
            return []
        fields = data[name].get(column, [])
        while not fields and '/' in name:
            # Move up the hierarchy
            name = name.rsplit('/', 1)[0]
            if name in data:
                fields = data[name].get(column, [])

        i = 0
        while i < len(fields):
            if fields[i][0] == '{':
                # Replace e.g. "{building}" with fields from the bulding preset.
                # Note that there can be multiple references, so we continue
                # processing the items.
                # Enclosed references are resolved with recursion.
                ref = fields[i][1:-1]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…