equal
deleted
inserted
replaced
12 import os |
12 import os |
13 import re |
13 import re |
14 import stat |
14 import stat |
15 import typing |
15 import typing |
16 |
16 |
17 from typing import Generator, List |
17 from typing import ( |
|
18 Generator, |
|
19 List, |
|
20 Optional, |
|
21 ) |
18 |
22 |
19 from .i18n import _ |
23 from .i18n import _ |
20 from .thirdparty import attr |
24 from .thirdparty import attr |
21 |
25 |
22 # Force pytype to use the non-vendored package |
26 # Force pytype to use the non-vendored package |
1133 ) |
1137 ) |
1134 if not notload: |
1138 if not notload: |
1135 self.fncache.add(path) |
1139 self.fncache.add(path) |
1136 return self.vfs(encoded, mode, *args, **kw) |
1140 return self.vfs(encoded, mode, *args, **kw) |
1137 |
1141 |
1138 def join(self, path): |
1142 def join(self, path: Optional[bytes], *insidef: bytes) -> bytes: |
|
1143 insidef = (self.encode(f) for f in insidef) |
|
1144 |
1139 if path: |
1145 if path: |
1140 return self.vfs.join(self.encode(path)) |
1146 return self.vfs.join(self.encode(path), *insidef) |
1141 else: |
1147 else: |
1142 return self.vfs.join(path) |
1148 return self.vfs.join(path, *insidef) |
1143 |
1149 |
1144 def register_file(self, path): |
1150 def register_file(self, path): |
1145 """generic hook point to lets fncache steer its stew""" |
1151 """generic hook point to lets fncache steer its stew""" |
1146 if path.startswith(b'data/') or path.startswith(b'meta/'): |
1152 if path.startswith(b'data/') or path.startswith(b'meta/'): |
1147 self.fncache.add(path) |
1153 self.fncache.add(path) |