MCPcopy Create free account
hub / github.com/StarsTom/mobileCodexHelper / pick_mobile_display_name

Function pick_mobile_display_name

mobile_codex_control.py:513–523  ·  view source on GitHub ↗
(peer: dict[str, Any])

Source from the content-addressed store, hash-verified

511
512
513def pick_mobile_display_name(peer: dict[str, Any]) -> str:
514 host_name = str(peer.get("HostName") or "").strip()
515 dns_name = normalize_dns_name(peer.get("DNSName")) or ""
516 tail_ip = (peer.get("TailscaleIPs") or [""])[0]
517 if host_name and host_name.lower() != "localhost":
518 return host_name
519 if dns_name:
520 return dns_name
521 if tail_ip:
522 return tail_ip
523 return "未命名手机"
524
525
526def extract_mobile_peers(tailscale_status: dict[str, Any]) -> list[dict[str, Any]]:

Callers 1

extract_mobile_peersFunction · 0.85

Calls 1

normalize_dns_nameFunction · 0.85

Tested by

no test coverage detected