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

Remove ; from buildroot/scripts** .py files #26426

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions buildroot/share/PlatformIO/scripts/chitu_crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
board = marlin.env.BoardConfig()

def calculate_crc(contents, seed):
accumulating_xor_value = seed;
accumulating_xor_value = seed

for i in range(0, len(contents), 4):
value = struct.unpack('<I', contents[ i : i + 4])[0]
Expand Down Expand Up @@ -68,7 +68,7 @@ def encrypt_file(input, output_file, file_length):
uid_value = uuid.uuid4()
file_key = int(uid_value.hex[0:8], 16)

xor_crc = 0xEF3D4323;
xor_crc = 0xEF3D4323

# the input file is exepcted to be in chunks of 0x800
# so round the size
Expand Down Expand Up @@ -123,4 +123,4 @@ def encrypt(source, target, env):
fwpath.unlink()

marlin.relocate_firmware("0x08008800")
marlin.add_post_action(encrypt);
marlin.add_post_action(encrypt)
2 changes: 1 addition & 1 deletion buildroot/share/PlatformIO/scripts/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def apply_config_ini(cp):
cp2 = configparser.ConfigParser()
cp2.read(config_path(ckey))
apply_sections(cp2, sect)
ckey = 'base';
ckey = 'base'

# (Allow 'example/' as a shortcut for 'examples/')
elif ckey.startswith('example/'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

assert isfile(original_file) and isfile(src_file)
shutil.copyfile(original_file, backup_file)
shutil.copyfile(src_file, original_file);
shutil.copyfile(src_file, original_file)

def _touch(path):
with open(path, "w") as fp:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def addboot(source, target, env):
fw_path.rename(fws_path)

import marlin
marlin.add_post_action(addboot);
marlin.add_post_action(addboot)
2 changes: 1 addition & 1 deletion buildroot/share/PlatformIO/scripts/marlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ def encrypt_mks(source, target, env, new_name):
fwpath.unlink()

def add_post_action(action):
env.AddPostAction(str(Path("$BUILD_DIR", "${PROGNAME}.bin")), action);
env.AddPostAction(str(Path("$BUILD_DIR", "${PROGNAME}.bin")), action)
2 changes: 1 addition & 1 deletion buildroot/share/PlatformIO/scripts/preflight-checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def sanity_check_target():
# Find the name.cpp.o or name.o and remove it
#
def rm_ofile(subdir, name):
build_dir = Path(env['PROJECT_BUILD_DIR'], build_env);
build_dir = Path(env['PROJECT_BUILD_DIR'], build_env)
for outdir in (build_dir, build_dir / "debug"):
for ext in (".cpp.o", ".o"):
fpath = outdir / "src/src" / subdir / (name + ext)
Expand Down
24 changes: 12 additions & 12 deletions buildroot/share/scripts/MarlinBinaryProtocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, device, baud, bsize, simerr, timeout):
self.device = device
self.baud = baud
self.block_size = int(bsize)
self.simulate_errors = max(min(simerr, 1.0), 0.0);
self.simulate_errors = max(min(simerr, 1.0), 0.0)
self.connected = True
self.response_timeout = timeout

Expand Down Expand Up @@ -237,8 +237,8 @@ def build_packet(self, protocol, packet_type, data = bytearray()):

# checksum 16 fletchers
def checksum(self, cs, value):
cs_low = (((cs & 0xFF) + value) % 255);
return ((((cs >> 8) + cs_low) % 255) << 8) | cs_low;
cs_low = (((cs & 0xFF) + value) % 255)
return ((((cs >> 8) + cs_low) % 255) << 8) | cs_low

def build_checksum(self, buffer):
cs = 0
Expand Down Expand Up @@ -270,7 +270,7 @@ def disconnect(self):

def response_ok(self, data):
try:
packet_id = int(data);
packet_id = int(data)
except ValueError:
return
if packet_id != self.sync:
Expand All @@ -279,7 +279,7 @@ def response_ok(self, data):
self.packet_status = 1

def response_resend(self, data):
packet_id = int(data);
packet_id = int(data)
self.errors += 1
if not self.syncronised:
print("Retrying syncronisation")
Expand Down Expand Up @@ -330,7 +330,7 @@ def await_response(self, timeout = None):
return self.responses.popleft()

def connect(self):
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.QUERY);
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.QUERY)

token, data = self.await_response()
if token != 'PFT:version:':
Expand All @@ -352,7 +352,7 @@ def open(self, filename, compression, dummy):

timeout = TimeOut(5000)
token = None
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.OPEN, payload);
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.OPEN, payload)
while token != 'PFT:success' and not timeout.timedout():
try:
token, data = self.await_response(1000)
Expand All @@ -363,7 +363,7 @@ def open(self, filename, compression, dummy):
print("Broken transfer detected, purging")
self.abort()
time.sleep(0.1)
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.OPEN, payload);
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.OPEN, payload)
timeout.reset()
elif token == 'PFT:fail':
raise Exception("Can not open file on client")
Expand All @@ -372,10 +372,10 @@ def open(self, filename, compression, dummy):
raise ReadTimeout()

def write(self, data):
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.WRITE, data);
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.WRITE, data)

def close(self):
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.CLOSE);
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.CLOSE)
token, data = self.await_response(1000)
if token == 'PFT:success':
print("File closed")
Expand All @@ -388,7 +388,7 @@ def close(self):
return False

def abort(self):
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.ABORT);
self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.ABORT)
token, data = self.await_response()
if token == 'PFT:success':
print("Transfer Aborted")
Expand Down Expand Up @@ -432,7 +432,7 @@ def copy(self, filename, dest_filename, compression, dummy):
self.close()
print("Transfer aborted due to protocol errors")
#raise Exception("Transfer aborted due to protocol errors")
return False;
return False
print("\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3}".format(100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression else "", self.protocol.errors)) # no one likes transfers finishing at 99.8%

if not self.close():
Expand Down
2 changes: 1 addition & 1 deletion buildroot/share/vscode/auto_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down