Use TOC to return subpath for given key, or raise a KeyError.
(self, key)
| 600 | self._last_read = time.time() |
| 601 | |
| 602 | def _lookup(self, key): |
| 603 | """Use TOC to return subpath for given key, or raise a KeyError.""" |
| 604 | try: |
| 605 | if os.path.exists(os.path.join(self._path, self._toc[key])): |
| 606 | return self._toc[key] |
| 607 | except KeyError: |
| 608 | pass |
| 609 | self._refresh() |
| 610 | try: |
| 611 | return self._toc[key] |
| 612 | except KeyError: |
| 613 | raise KeyError('No message with key: %s' % key) from None |
| 614 | |
| 615 | # This method is for backward compatibility only. |
| 616 | def next(self): |