mdns_beacon.cli package


mdns_beacon.cli.layouts module

Console layout for mdns-beacon.

class mdns_beacon.cli.layouts.BaseLayout(live:[source]

Bases: abc.ABC

Base cli layout.


Derived layouts must override the renderable property.

abstract property renderable

Get the renderable layout.

Property that derived layouts must override.

property spinner

Spinner status annimation.

abstract property spinner_text

Get the spinner text to render.

Property that derived layouts must override.

class mdns_beacon.cli.layouts.BlinkLayout(live:[source]

Bases: mdns_beacon.cli.layouts.BaseLayout

Blink cli layout.

property renderable

Blink renderable layout (spinner with status).

spinner_text = 'Announcing services (Press CTRL+C to quit) ...'
class mdns_beacon.cli.layouts.ListenLayout(show_columns: Optional[Union[Tuple[str], List[str]]] = None, *args: Any, **kwargs: Any)[source]

Bases: mdns_beacon.cli.layouts.BaseLayout

Listen cli layout.

DEFAULT_SHOW_COLUMNS = ('type', 'name', 'ipv4_address', 'port', 'server', 'ttl')
TABLE_SERVICES_COLUMNS = {'ipv4_address': 'Address IPv4', 'ipv6_address': 'Address IPv6', 'name': 'Name', 'port': 'Port', 'priority': 'Priority', 'properties': 'Properties', 'server': 'Server', 'text': 'TXT', 'ttl': 'TTL', 'type': 'Type', 'weight': 'Weight'}
property renderable

Listen renderable layout (a table with spinner and status).

services: Dict[str, Any] = {}
property services_table

Listen services table.

spinner_text = 'Listen for services (Press CTRL+C to quit) ...'
update_services(zeroconf: zeroconf.Zeroconf, service_type: str, name: str, state_change: zeroconf.ServiceStateChange)None[source]

On service state change handler.

mdns_beacon.cli.main module

Main script for mdns-beacon.

mdns_beacon.cli.types module

Param types for mdns-beacon.

class mdns_beacon.cli.types.IpAddress[source]

Bases: click.types.ParamType

An IPv4Address or IPv6Address parsed via ipaddress.ip_address.


>>> ptype = IpAddress()
>>> ptype.convert("", None, None)
convert(value: AnyStr, param: Optional[click.core.Parameter], ctx: Optional[click.core.Context])Union[ipaddress.IPv4Address, ipaddress.IPv6Address][source]

Parse value into IPv4Address or IPv6Address.

name = 'ip_address'

the descriptive name of this type

Module contents

Console script for mdns-beacon.