MCPcopy Create free account
hub / github.com/python-hyper/uritemplate / __init__

Method __init__

uritemplate/template.py:70–83  ·  view source on GitHub ↗
(self, uri: str)

Source from the content-addressed store, hash-verified

68 """
69
70 def __init__(self, uri: str):
71 #: The original URI to be parsed.
72 self.uri: str = uri
73 #: A list of the variables in the URI. They are stored as
74 #: :class:`~uritemplate.variable.URIVariable`\ s
75 self.variables: t.List[variable.URIVariable] = [
76 variable.URIVariable(m.groups()[0])
77 for m in template_re.finditer(self.uri)
78 ]
79 #: A set of variable names in the URI.
80 self.variable_names = orderedset.OrderedSet()
81 for var in self.variables:
82 for name in var.variable_names:
83 self.variable_names.add(name)
84
85 def __repr__(self) -> str:
86 return 'URITemplate("%s")' % self

Callers

nothing calls this directly

Calls 1

addMethod · 0.80

Tested by

no test coverage detected