Skip to content

Commit b375a2e

Browse files
committed
chore: skip empty txt keys in the example display
1 parent 0b1087d commit b375a2e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎examples/async_apple_scanner.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def show_info(info: AsyncServiceInfo) -> None:
5050
print(f" reachable at: {', '.join(info.parsed_scoped_addresses())}")
5151
print(f" host {info.server} port {info.port} (priority {info.priority}, weight {info.weight})")
5252
for key, value in info.decoded_properties.items():
53+
if not key:
54+
continue
5355
print(f" txt {key} = {value}")
5456

5557

‎examples/async_service_info_request.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ async def resolve_all(zeroconf: Zeroconf, names: set[str]) -> None:
2727
print(f" reachable at: {', '.join(info.parsed_scoped_addresses())}")
2828
print(f" host {info.server} port {info.port} (priority {info.priority}, weight {info.weight})")
2929
for key, value in info.decoded_properties.items():
30+
if not key:
31+
continue
3032
print(f" txt {key} = {value}")
3133

3234

0 commit comments

Comments
 (0)