Generate world and social API shims
This commit is contained in:
@@ -384,6 +384,10 @@ def rust_constant_value(item: dict) -> str:
|
||||
return json.dumps(value)
|
||||
if item["type"] == "System.Boolean":
|
||||
return value.lower()
|
||||
if item["type"] in {"System.Single", "System.Double"} and not any(
|
||||
marker in value.lower() for marker in (".", "e")
|
||||
):
|
||||
return value + ".0"
|
||||
return value
|
||||
|
||||
|
||||
@@ -500,6 +504,10 @@ def avatar_type(item: dict) -> bool:
|
||||
)
|
||||
|
||||
|
||||
def world_type(item: dict) -> bool:
|
||||
return not wire_type(item) and not core_type(item) and not avatar_type(item)
|
||||
|
||||
|
||||
def render_modules(items: list[tuple[dict, dict, bool]], member_rows: dict[str, dict[str, str]], mapper: mapping.Mapper) -> str:
|
||||
tree: dict = {"items": [], "children": {}}
|
||||
for item, type_row, complete in items:
|
||||
@@ -558,7 +566,11 @@ def generate_sources(catalog: dict) -> tuple[dict[Path, str], dict[str, tuple[in
|
||||
selected = (
|
||||
assembly["types"]
|
||||
if name in TARGETS
|
||||
else [item for item in assembly["types"] if wire_type(item) or core_type(item) or avatar_type(item)]
|
||||
else [
|
||||
item
|
||||
for item in assembly["types"]
|
||||
if wire_type(item) or core_type(item) or avatar_type(item) or world_type(item)
|
||||
]
|
||||
)
|
||||
selected_ids = {item["doc_id"] for item in selected}
|
||||
rendered_items = [
|
||||
@@ -602,7 +614,7 @@ def coverage_report(catalog: dict, coverage: dict[str, tuple[int, int, bool]]) -
|
||||
else:
|
||||
status = "pending milestone issue"
|
||||
lines.append(f"| `{name}` | {types:,} | {members:,} | {status} |")
|
||||
if "LibreMetaverse" in coverage and not coverage["LibreMetaverse"][2]:
|
||||
if "LibreMetaverse" in coverage:
|
||||
main_types = next(
|
||||
assembly["types"]
|
||||
for assembly in catalog["assemblies"]
|
||||
@@ -615,17 +627,27 @@ def coverage_report(catalog: dict, coverage: dict[str, tuple[int, int, bool]]) -
|
||||
for item in main_types
|
||||
if avatar_type(item) and not wire_type(item) and not core_type(item)
|
||||
]
|
||||
world_types = [item for item in main_types if world_type(item)]
|
||||
complete = coverage["LibreMetaverse"][2]
|
||||
lines += [
|
||||
"",
|
||||
"The partial `LibreMetaverse` row contains the completed issue #7 wire/data, issue #8 core",
|
||||
"runtime/networking, and issue #9 avatar-facing manager slices. World/social/service manager types",
|
||||
"remain pending shells for issue #10.",
|
||||
(
|
||||
"The `LibreMetaverse` assembly is complete across issue #7 wire/data, issue #8 core runtime/networking,"
|
||||
if complete
|
||||
else "The partial `LibreMetaverse` row contains the completed issue #7 wire/data, issue #8 core runtime/networking,"
|
||||
),
|
||||
(
|
||||
"issue #9 avatar-facing manager, and issue #10 world/social/service manager slices."
|
||||
if complete
|
||||
else "and issue #9 avatar-facing manager slices. World/social/service manager types remain pending for issue #10."
|
||||
),
|
||||
"",
|
||||
"| Main assembly slice | Types | Members |",
|
||||
"|---|---:|---:|",
|
||||
f"| Issue #7 wire/data | {len(wire_types):,} | {sum(len(item['members']) for item in wire_types):,} |",
|
||||
f"| Issue #8 core runtime/networking | {len(core_types):,} | {sum(len(item['members']) for item in core_types):,} |",
|
||||
f"| Issue #9 avatar-facing managers | {len(avatar_types):,} | {sum(len(item['members']) for item in avatar_types):,} |",
|
||||
f"| Issue #10 world/social/service managers | {len(world_types):,} | {sum(len(item['members']) for item in world_types):,} |",
|
||||
]
|
||||
lines += ["", f"Current callable coverage: **{total_types:,} types / {total_members:,} members**.", ""]
|
||||
return "\n".join(lines)
|
||||
|
||||
Reference in New Issue
Block a user