PYME.misc.pyme_zeroconf module

pyme_zeroconf.py

This implements a decentralized nameserver for PYRO based on using the zeroconf (aka Bonjour) automated service discovery protocol

class PYME.misc.pyme_zeroconf.PatchedServiceInfo(type_, name, address=None, port=None, weight=0, priority=0, properties=None, server=None)

Bases: zeroconf.ServiceInfo

A patched version of the zero-conf ServiceInfo object which ensures that we get the port number as well as the address and name

Attributes

properties

Methods

request(zc, timeout) Returns true if the service could be discovered on the network, and updates this object with details discovered.

Create a service description.

type_: fully qualified service type name name: fully qualified service name address: IP address as unsigned short, network byte order port: port that the service runs on weight: weight of the service priority: priority of the service properties: dictionary of properties (or a string holding the

bytes for the text field)

server: fully qualified name for service host (defaults to name)

Attributes

properties

Methods

request(zc, timeout) Returns true if the service could be discovered on the network, and updates this object with details discovered.
request(zc, timeout)

Returns true if the service could be discovered on the network, and updates this object with details discovered.

class PYME.misc.pyme_zeroconf.ZCListener(protocol='_pyme-pyro')

Bases: object

Methods

add_service(zc, _type, name)
get_advertised_services()
get_info(name)
list(filterby)
remove_service(zc, _type, name)
add_service(zc, _type, name)
get_advertised_services()
get_info(name)
list(filterby)
remove_service(zc, _type, name)
class PYME.misc.pyme_zeroconf.ZeroConfNS(protocol='_pyme-pyro')

Bases: object

This spoofs (but does not fully re-implement) a Pyro.naming.Nameserver

Methods

get_advertised_services()
list([filterby])
register(name, URI)
register_service(name, address, port[, desc])
resolve(name)
unregister(name)
get_advertised_services()
list(filterby='')
register(name, URI)
register_service(name, address, port, desc={})
resolve(name)
unregister(name)
PYME.misc.pyme_zeroconf.getNS(protocol='_pyme-pyro')