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: Union[rich.console.ConsoleRenderable, rich.console.RichCast, str]

Get the renderable layout.

Property that derived layouts must override.

property spinner: rich.spinner.Spinner

Spinner status annimation.

abstract property spinner_text: str

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: rich.table.Table

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: Union[rich.console.ConsoleRenderable, rich.console.RichCast, str]

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

services: Dict[str, Any] = {}
property services_table: rich.table.Table

Listen services table.

spinner_text = 'Listen for services (Press CTRL+C to quit) ...'
update_services(zeroconf: zeroconf._core.Zeroconf, service_type: str, name: str, state_change: zeroconf._services.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]) Optional[Union[ipaddress.IPv4Address, ipaddress.IPv6Address]][source]

Parse value into IPv4Address or IPv6Address.

name: str = 'ip_address'

the descriptive name of this type

Module contents

Console script for mdns-beacon.