Set the keyed message's "info" string.
(self, key, info: str)
| 403 | return '' |
| 404 | |
| 405 | def set_info(self, key, info: str): |
| 406 | """Set the keyed message's "info" string.""" |
| 407 | if not isinstance(info, str): |
| 408 | raise TypeError(f'info must be a string: {type(info)}') |
| 409 | old_subpath = self._lookup(key) |
| 410 | new_subpath = old_subpath.split(self.colon)[0] |
| 411 | if info: |
| 412 | new_subpath += self.colon + info |
| 413 | if new_subpath == old_subpath: |
| 414 | return |
| 415 | old_path = os.path.join(self._path, old_subpath) |
| 416 | new_path = os.path.join(self._path, new_subpath) |
| 417 | os.rename(old_path, new_path) |
| 418 | self._toc[key] = new_subpath |
| 419 | |
| 420 | def get_flags(self, key): |
| 421 | """Return as a string the standard flags that are set on the keyed message.""" |