MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / parse_versions

Function parse_versions

tasks/scripts/sync_docs_website.py:169–190  ·  view source on GitHub ↗
(raw_versions: object)

Source from the content-addressed store, hash-verified

167
168
169def parse_versions(raw_versions: object) -> list[VersionEntry]:
170 if raw_versions is None:
171 return []
172 if not isinstance(raw_versions, list):
173 raise ValueError("docs.yml versions must be a list")
174 entries: list[VersionEntry] = []
175 for raw in cast("list[object]", raw_versions):
176 if not isinstance(raw, dict):
177 continue
178 entry = cast("YamlMapping", raw)
179 slug = entry.get("slug")
180 display_name = entry.get("display-name")
181 path = entry.get("path")
182 if (
183 isinstance(slug, str)
184 and isinstance(display_name, str)
185 and isinstance(path, str)
186 ):
187 entries.append(
188 VersionEntry(slug=slug, display_name=display_name, path=path)
189 )
190 return entries
191
192
193def ordered_entries(

Callers 2

update_docs_ymlFunction · 0.85
remove_docs_yml_entryFunction · 0.85

Calls 2

VersionEntryClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected