(self, mo)
| 107 | # Search for $$, $identifier, ${identifier}, and any bare $'s |
| 108 | |
| 109 | def _invalid(self, mo): |
| 110 | i = mo.start('invalid') |
| 111 | lines = self.template[:i].splitlines(keepends=True) |
| 112 | if not lines: |
| 113 | colno = 1 |
| 114 | lineno = 1 |
| 115 | else: |
| 116 | colno = i - len(''.join(lines[:-1])) |
| 117 | lineno = len(lines) |
| 118 | raise ValueError('Invalid placeholder in string: line %d, col %d' % |
| 119 | (lineno, colno)) |
| 120 | |
| 121 | def substitute(self, mapping=_sentinel_dict, /, **kws): |
| 122 | if mapping is _sentinel_dict: |
no test coverage detected