| 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 |