Return the bytes of the resource file at path, or None. If builtin is True, do not look for it on the filesystem. If builtin is False, do not look in the builtin resources.
(path, builtin=None)
| 257 | |
| 258 | |
| 259 | def resfs_read(path, builtin=None): |
| 260 | """ |
| 261 | Return the bytes of the resource file at path, or None. |
| 262 | If builtin is True, do not look for it on the filesystem. |
| 263 | If builtin is False, do not look in the builtin resources. |
| 264 | """ |
| 265 | if builtin is not True: |
| 266 | arcpath = resfs_src(path, resfs_file=True) |
| 267 | if arcpath: |
| 268 | fspath = resfs_resolve(arcpath) |
| 269 | if fspath: |
| 270 | return file_bytes(fspath) |
| 271 | |
| 272 | if builtin is not False: |
| 273 | return find(b'resfs/file/' + _b(path)) |
| 274 | |
| 275 | |
| 276 | def resfs_files(prefix=b''): |
no test coverage detected