##// END OF EJS Templates
typing: add a handful more annotations to `mercurial/vfs.py`...
Matt Harbison -
r52787:992fcf6b default
parent child Browse files
Show More
@@ -19,6 +19,7 from typing import (
19 Any,
19 Any,
20 BinaryIO,
20 BinaryIO,
21 Callable,
21 Callable,
22 Dict,
22 Iterable,
23 Iterable,
23 Iterator,
24 Iterator,
24 List,
25 List,
@@ -27,6 +28,7 from typing import (
27 Tuple,
28 Tuple,
28 Type,
29 Type,
29 TypeVar,
30 TypeVar,
31 Union,
30 )
32 )
31
33
32 from .i18n import _
34 from .i18n import _
@@ -455,7 +457,12 class vfs(abstractvfs):
455 See pathutil.pathauditor() for details.
457 See pathutil.pathauditor() for details.
456 """
458 """
457
459
460 audit: Union[pathutil.pathauditor, Callable[[bytes, Optional[bytes]], Any]]
461 base: bytes
458 createmode: Optional[int]
462 createmode: Optional[int]
463 options: Dict[bytes, Any]
464 _audit: bool
465 _trustnlink: Optional[bool]
459
466
460 def __init__(
467 def __init__(
461 self,
468 self,
@@ -688,11 +695,11 class proxyvfs(abstractvfs, abc.ABC):
688 return self.vfs._auditpath(path, mode)
695 return self.vfs._auditpath(path, mode)
689
696
690 @property
697 @property
691 def options(self):
698 def options(self) -> Dict[bytes, Any]:
692 return self.vfs.options
699 return self.vfs.options
693
700
694 @options.setter
701 @options.setter
695 def options(self, value):
702 def options(self, value: Dict[bytes, Any]) -> None:
696 self.vfs.options = value
703 self.vfs.options = value
697
704
698 @property
705 @property
@@ -703,7 +710,7 class proxyvfs(abstractvfs, abc.ABC):
703 class filtervfs(proxyvfs, abstractvfs):
710 class filtervfs(proxyvfs, abstractvfs):
704 '''Wrapper vfs for filtering filenames with a function.'''
711 '''Wrapper vfs for filtering filenames with a function.'''
705
712
706 def __init__(self, vfs: vfs, filter) -> None:
713 def __init__(self, vfs: vfs, filter: Callable[[bytes], bytes]) -> None:
707 proxyvfs.__init__(self, vfs)
714 proxyvfs.__init__(self, vfs)
708 self._filter = filter
715 self._filter = filter
709
716
General Comments 0
You need to be logged in to leave comments. Login now