MCPcopy Create free account
hub / github.com/andreikop/python-ws-discovery / publish

Function publish

wsdiscovery/cmdline.py:102–120  ·  view source on GitHub ↗

Publish services using WS-Discovery

(scope, typename, address, port, loglevel, capture, unicast_num,
            multicast_num)

Source from the content-addressed store, hash-verified

100@click.option('--multicast-num', '-mn', type=int, default=MULTICAST_UDP_REPEAT,
101 show_default=True, help='Number of Multicast messages to send')
102def publish(scope, typename, address, port, loglevel, capture, unicast_num,
103 multicast_num):
104 "Publish services using WS-Discovery"
105
106 logger = setup_logger("ws-publishing", loglevel)
107
108 with publishing(capture) as wsp:
109 scopes = [Scope(scope)] if scope else []
110
111 try:
112 proto, ns, name = typename.split(':')
113 except:
114 types = []
115 else:
116 ns = ns[2:]
117 types = [QName(proto, ns)]
118
119 xAddrs = ["%s:%i" % (address, port)] if address else ['127.0.0.1']
120 svc = wsp.publishService(types, scopes, xAddrs)

Callers

nothing calls this directly

Calls 5

ScopeClass · 0.90
QNameClass · 0.90
setup_loggerFunction · 0.85
publishingFunction · 0.85
publishServiceMethod · 0.80

Tested by

no test coverage detected