Returns the elements used by show() If a tuple is returned, this consist of the strings that will be inlined along with the interface. If a list of tuples is returned, they will be appended one above the other and should all be part of a single interface.
(self,
dev, # type: NetworkInterface
**kwargs # type: Any
)
| 79 | return bool((dev.ips[4] or dev.ips[6]) and dev.mac) |
| 80 | |
| 81 | def _format(self, |
| 82 | dev, # type: NetworkInterface |
| 83 | **kwargs # type: Any |
| 84 | ): |
| 85 | # type: (...) -> Tuple[Union[str, List[str]], ...] |
| 86 | """Returns the elements used by show() |
| 87 | |
| 88 | If a tuple is returned, this consist of the strings that will be |
| 89 | inlined along with the interface. |
| 90 | If a list of tuples is returned, they will be appended one above the |
| 91 | other and should all be part of a single interface. |
| 92 | """ |
| 93 | mac = dev.mac |
| 94 | resolve_mac = kwargs.get("resolve_mac", True) |
| 95 | if resolve_mac and conf.manufdb and mac: |
| 96 | mac = conf.manufdb._resolve_MAC(mac) |
| 97 | index = str(dev.index) |
| 98 | return (index, dev.description, mac or "", dev.ips[4], dev.ips[6]) |
| 99 | |
| 100 | def __repr__(self) -> str: |
| 101 | """ |
no test coverage detected