Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow up to 🎨 Python ; cleanup (#26426) #26427

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace ';[ \t]*$' in .py with ''
thinkyhead committed Nov 14, 2023
commit 6f648789823154431357b81b97bd0e0d5a4482a9
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ def deflate(data):
parser.add_argument("-d", "--deflate", action="store_true", help="Packs the data using the deflate algorithm")
args = parser.parse_args()

varname = os.path.splitext(os.path.basename(args.input))[0];
varname = os.path.splitext(os.path.basename(args.input))[0]

with open(args.input, "rb") as in_file:
data = in_file.read()
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ def write(self):
if len(self.values):
self.blocks.append(self.values)

block_strs = [];
block_strs = []
for b in self.blocks:
data = self.convert_to_4bpp(b)
data = ', '.join(data)
Original file line number Diff line number Diff line change
@@ -44,12 +44,12 @@ def add_bits_to_byte(self, value, size = 1):

def append_rgb565(self, color):
value = ((color[0] & 0xF8) << 8) + ((color[1] & 0xFC) << 3) + ((color[2] & 0xF8) >> 3)
self.values.append((value & 0x00FF) >> 0);
self.values.append((value & 0xFF00) >> 8);
self.values.append((value & 0x00FF) >> 0)
self.values.append((value & 0xFF00) >> 8)

def append_rgb332(self, color):
value = (color[0] & 0xE0) + ((color[1] & 0xE0) >> 3) + ((color[2] & 0xC0) >> 6)
self.values.append(value);
self.values.append(value)

def append_grayscale(self, color, bits):
luminance = int(0.2126 * color[0] + 0.7152 * color[1] + 0.0722 * color[2])
@@ -99,7 +99,7 @@ def write(self, varname, deflate):
parser.add_argument("-m", "--mode", default="l1", help="Mode, can be l1, l2, l4, l8, rgb332 or rgb565")
args = parser.parse_args()

varname = os.path.splitext(os.path.basename(args.input))[0];
varname = os.path.splitext(os.path.basename(args.input))[0]

writer = WriteSource(args.mode)

2 changes: 1 addition & 1 deletion buildroot/share/vscode/auto_build.py
Original file line number Diff line number Diff line change
@@ -499,7 +499,7 @@ def get_starting_env(board_name_full, version):
possible_envs = None
for i, line in enumerate(pins_h):
if 0 < line.find("Unknown MOTHERBOARD value set in Configuration.h"):
invalid_board();
invalid_board()
if list_start_found == False and 0 < line.find('1280'):
list_start_found = True
elif list_start_found == False: # skip lines until find start of CPU list