File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import struct
6
6
from collections import namedtuple
7
- from typing import ByteString
8
7
9
8
__all__ = ["Edid" ]
10
9
@@ -108,10 +107,10 @@ class Edid:
108
107
),
109
108
)
110
109
111
- def __init__ (self , edid : ByteString ):
110
+ def __init__ (self , edid : bytes ):
112
111
self ._parse_edid (edid )
113
112
114
- def _parse_edid (self , edid : ByteString ):
113
+ def _parse_edid (self , edid : bytes ):
115
114
"""Convert edid byte string to edid object"""
116
115
if struct .calcsize (self ._STRUCT_FORMAT ) != 128 :
117
116
raise ValueError ("Wrong edid size." )
Original file line number Diff line number Diff line change 3
3
"""
4
4
5
5
from subprocess import CalledProcessError , check_output
6
- from typing import ByteString , List
6
+ from typing import List
7
7
8
8
__all__ = ["EdidHelper" ]
9
9
@@ -12,14 +12,14 @@ class EdidHelper:
12
12
"""Class for working with EDID data"""
13
13
14
14
@staticmethod
15
- def hex2bytes (hex_data : str ) -> ByteString :
15
+ def hex2bytes (hex_data : str ) -> bytes :
16
16
"""Convert hex EDID string to bytes
17
17
18
18
Args:
19
19
hex_data (str): hex edid string
20
20
21
21
Returns:
22
- ByteString : edid byte string
22
+ bytes : edid byte string
23
23
"""
24
24
# delete edid 1.3 additional block
25
25
if len (hex_data ) > 256 :
@@ -32,14 +32,14 @@ def hex2bytes(hex_data: str) -> ByteString:
32
32
return bytes (numbers )
33
33
34
34
@classmethod
35
- def get_edids (cls ) -> List [ByteString ]:
35
+ def get_edids (cls ) -> List [bytes ]:
36
36
"""Get edids from xrandr
37
37
38
38
Raises:
39
39
`RuntimeError`: if error with retrieving xrandr util data
40
40
41
41
Returns:
42
- List[ByteString ]: list with edids
42
+ List[bytes ]: list with edids
43
43
"""
44
44
try :
45
45
output = check_output (["xrandr" , "--verbose" ])
You can’t perform that action at this time.
0 commit comments