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

Class URI

wsdiscovery/uri.py:6–36  ·  view source on GitHub ↗

URI implementation with additional functionality useful for service scope matching

Source from the content-addressed store, hash-verified

4
5
6class URI:
7 "URI implementation with additional functionality useful for service scope matching"
8
9 def __init__(self, uri):
10 uri = unquote(uri)
11 i1 = uri.find(":")
12 i2 = uri.find("@")
13 self._scheme = uri[:i1]
14 if i2 != -1:
15 self._authority = uri[i1 + 1: i2]
16 self._path = uri[i2 + 1:]
17 else:
18 self._authority = ""
19 self._path = uri[i1 + 1:]
20
21 def getScheme(self):
22 return self._scheme
23
24 def getAuthority(self):
25 return self._authority
26
27 def getPath(self):
28 return self._path
29
30 def getPathExQueryFragment(self):
31 i = self._path.find("?")
32 path = self.getPath()
33 if i != -1:
34 return path[:self._path.find("?")]
35 else:
36 return path
37

Callers 2

matchScopeFunction · 0.85
_handle_helloMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected