| 2907 | |
| 2908 | |
| 2909 | class BitMultiEnumField(_BitField[Union[List[int], int]], |
| 2910 | _MultiEnumField[int]): |
| 2911 | __slots__ = EnumField.__slots__ + MultiEnumField.__slots__ |
| 2912 | |
| 2913 | def __init__( |
| 2914 | self, |
| 2915 | name, # type: str |
| 2916 | default, # type: int |
| 2917 | size, # type: int |
| 2918 | enum, # type: Dict[int, Dict[int, str]] |
| 2919 | depends_on # type: Callable[[Optional[Packet]], int] |
| 2920 | ): |
| 2921 | # type: (...) -> None |
| 2922 | _MultiEnumField.__init__(self, name, default, enum, depends_on) |
| 2923 | self.rev = size < 0 |
| 2924 | self.size = abs(size) |
| 2925 | self.sz = self.size / 8. # type: ignore |
| 2926 | |
| 2927 | def any2i(self, pkt, x): |
| 2928 | # type: (Optional[Packet], Any) -> Union[List[int], int] |
| 2929 | return _MultiEnumField[int].any2i( |
| 2930 | self, # type: ignore |
| 2931 | pkt, |
| 2932 | x |
| 2933 | ) |
| 2934 | |
| 2935 | def i2repr( # type: ignore |
| 2936 | self, |
| 2937 | pkt, # type: Optional[Packet] |
| 2938 | x # type: Union[List[int], int] |
| 2939 | ): |
| 2940 | # type: (...) -> Union[str, List[str]] |
| 2941 | return _MultiEnumField[int].i2repr( |
| 2942 | self, # type: ignore |
| 2943 | pkt, |
| 2944 | x |
| 2945 | ) |
| 2946 | |
| 2947 | |
| 2948 | class ByteEnumKeysField(ByteEnumField): |
no outgoing calls
no test coverage detected
searching dependent graphs…