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