@@ -57,20 +57,20 @@ def init(self):
57
57
for command , data in self ._INIT :
58
58
self .write (command , data )
59
59
60
- #pylint: disable-msg=too-many-arguments
61
- def _block (self , xpos0 , ypos0 , xpos1 , ypos1 , data = None ):
60
+ #pylint: disable-msg=invalid-name, too-many-arguments
61
+ def _block (self , x0 , y0 , x1 , y1 , data = None ):
62
62
"""Read or write a block of data."""
63
- self .write (self ._COLUMN_SET , self ._encode_pos (xpos0 , xpos1 ))
64
- self .write (self ._PAGE_SET , self ._encode_pos (ypos0 , ypos1 ))
63
+ self .write (self ._COLUMN_SET , self ._encode_pos (x0 , x1 ))
64
+ self .write (self ._PAGE_SET , self ._encode_pos (y0 , y1 ))
65
65
if data is None :
66
66
size = struct .calcsize (self ._DECODE_PIXEL )
67
67
return self .read (self ._RAM_READ ,
68
- (xpos1 - xpos0 + 1 ) * (ypos1 - ypos0 + 1 ) * size )
68
+ (x1 - x0 + 1 ) * (y1 - y0 + 1 ) * size )
69
69
self .write (self ._RAM_WRITE , data )
70
70
return None
71
- #pylint: enable-msg=too-many-arguments
71
+ #pylint: enable-msg=invalid-name, too-many-arguments
72
72
73
- def _encode_pos (self , x , y ): #pylint: disable-msg=invalid-name
73
+ def _encode_pos (self , x , y ):
74
74
"""Encode a postion into bytes."""
75
75
return struct .pack (self ._ENCODE_POS , x , y )
76
76
@@ -82,7 +82,7 @@ def _decode_pixel(self, data):
82
82
"""Decode bytes into a pixel color."""
83
83
return color565 (* struct .unpack (self ._DECODE_PIXEL , data ))
84
84
85
- def pixel (self , x , y , color = None ): #pylint: disable-msg=invalid-name
85
+ def pixel (self , x , y , color = None ):
86
86
"""Read or write a pixel."""
87
87
if color is None :
88
88
return self ._decode_pixel (self ._block (x , y , x , y ))
@@ -92,7 +92,7 @@ def pixel(self, x, y, color=None): #pylint: disable-msg=invalid-name
92
92
return None
93
93
94
94
#pylint: disable-msg=too-many-arguments
95
- def fill_rectangle (self , x , y , width , height , color ): #pylint: disable-msg=invalid-name
95
+ def fill_rectangle (self , x , y , width , height , color ):
96
96
"""Draw a filled rectangle."""
97
97
x = min (self .width - 1 , max (0 , x ))
98
98
y = min (self .height - 1 , max (0 , y ))
@@ -112,11 +112,11 @@ def fill(self, color=0):
112
112
"""Fill whole screen."""
113
113
self .fill_rectangle (0 , 0 , self .width , self .height , color )
114
114
115
- def hline (self , x , y , width , color ): #pylint: disable-msg=invalid-name
115
+ def hline (self , x , y , width , color ):
116
116
"""Draw a horizontal line."""
117
117
self .fill_rectangle (x , y , width , 1 , color )
118
118
119
- def vline (self , x , y , height , color ): #pylint: disable-msg=invalid-name
119
+ def vline (self , x , y , height , color ):
120
120
"""Draw a vertical line."""
121
121
self .fill_rectangle (x , y , 1 , height , color )
122
122
0 commit comments