return path of file or None if it doesn't exist.
(self, bn)
| 246 | ] |
| 247 | |
| 248 | def get_path(self, bn): |
| 249 | """return path of file or None if it doesn't exist.""" |
| 250 | for path in self.paths: |
| 251 | fn = os.path.join(path, *bn.split("/")) |
| 252 | if os.path.exists(fn): |
| 253 | return fn |
| 254 | print(f"WARNING: path does not exist: {fn!r}") |
| 255 | return None |
| 256 | |
| 257 | def read_path(self, bn, mode="r"): |
| 258 | fn = self.get_path(bn) |
no test coverage detected