PYME.misc.sqlite_ns module

class PYME.misc.sqlite_ns.NSInfo(name, address, port, creation_time, URI)

Bases: tuple

Create new instance of NSInfo(name, address, port, creation_time, URI)

URI

Alias for field number 4

address

Alias for field number 1

creation_time

Alias for field number 3

name

Alias for field number 0

port

Alias for field number 2

class PYME.misc.sqlite_ns.SQLiteNS(protocol='_pyme-sql')

Bases: object

This spoofs (but does not fully re-implement) a Pyro.naming.Nameserver using a locally held sqlite database

In this case we are simply using sqlite as a key-value store which handles concurrent access across processes.

get_advertised_services()
list(filterby='')
register(name, URI)

This only exists for principally for pyro compatibility - use register_service for non pyro uses Takes a Pyro URI object

register_service(name, address, port, desc={}, URI='')
Parameters
namestr
remove_inactive_services()
resolve(name)

mainly for PYRO compatibility - returns a string version of the URI

unregister(name)
Parameters
namestr

must be the same service name used to register

PYME.misc.sqlite_ns.getNS(protocol='_pyme-pyro')
PYME.misc.sqlite_ns.is_port_open(ip, port)
PYME.misc.sqlite_ns.make_info(info)

Translate our results into something that looks like zeroconf.ServiceInfo - specifically convert the ip address into the expected format