Sets the given options as instance attributes (only if they are known). :param options: All known instance attributes and more if the child class has defined them before this call.
(self, options: dict)
| 183 | self._callbacks[action] = callback |
| 184 | |
| 185 | def set_options(self, options: dict) -> None: |
| 186 | """Sets the given options as instance attributes (only |
| 187 | if they are known). |
| 188 | |
| 189 | :param options: All known instance attributes and more if the child class |
| 190 | has defined them before this call. |
| 191 | """ |
| 192 | for key, val in options.items(): |
| 193 | key = key.lstrip("_") |
| 194 | if hasattr(self, key): |
| 195 | setattr(self, key, val) |
| 196 | |
| 197 | def packed(self, line: str) -> Generator[tuple[int, float], str, None]: |
| 198 | """ |