(self, temp_dir)
| 25 | |
| 26 | class DocumentDatabase: |
| 27 | def __init__(self, temp_dir): |
| 28 | self.temp_dir = TemporaryDirectory(dir=temp_dir) |
| 29 | self.working_dir = Path(self.temp_dir.name) |
| 30 | self.document_shelf_filepath = self.working_dir / 'shelf.db' |
| 31 | self.document_shelf = shelve.open(str(self.document_shelf_filepath), |
| 32 | flag='n', protocol=-1) |
| 33 | self.docids = [] |
| 34 | |
| 35 | def add_document(self, doc_id, document): |
| 36 | self.document_shelf[str(doc_id)] = document |
nothing calls this directly
no outgoing calls
no test coverage detected