🔨 Build scripts cleanup (#27157)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@@ -181,7 +181,7 @@ class Protocol(object):
|
||||
except ReadTimeout:
|
||||
self.errors += 1
|
||||
#print("Packetloss detected..")
|
||||
except serial.serialutil.SerialException:
|
||||
except serial.SerialException:
|
||||
return
|
||||
self.packet_transit = None
|
||||
|
||||
@@ -201,7 +201,7 @@ class Protocol(object):
|
||||
|
||||
def transmit_packet(self, packet):
|
||||
packet = bytearray(packet)
|
||||
if(self.simulate_errors > 0 and random.random() > (1.0 - self.simulate_errors)):
|
||||
if (self.simulate_errors > 0 and random.random() > (1.0 - self.simulate_errors)):
|
||||
if random.random() > 0.9:
|
||||
#random data drop
|
||||
start = random.randint(0, len(packet))
|
||||
|
@@ -22,7 +22,7 @@ from __future__ import print_function
|
||||
from __future__ import division
|
||||
|
||||
from math import *
|
||||
import sys,getopt
|
||||
import sys, getopt
|
||||
|
||||
"Constants"
|
||||
ZERO = 273.15 # zero point of Kelvin scale
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
# Generate Marlin TFT Images from bitmaps/PNG/JPG
|
||||
|
||||
import sys,struct
|
||||
import sys, struct
|
||||
from PIL import Image
|
||||
|
||||
def image2bin(image, output_file):
|
||||
|
@@ -17,7 +17,7 @@ TODO: Use the defines and comments above the namespace from existing language fi
|
||||
"""
|
||||
|
||||
import sys, re, requests, csv, datetime
|
||||
from languageUtil import namebyid
|
||||
#from languageUtil import namebyid
|
||||
|
||||
LANGHOME = "Marlin/src/lcd/language"
|
||||
OUTDIR = 'out-language'
|
||||
@@ -76,10 +76,10 @@ for row in reader:
|
||||
# Add the named string for all the included languages
|
||||
name = row[0]
|
||||
for i in range(1, numcols):
|
||||
str = row[i]
|
||||
if str:
|
||||
str_key = row[i]
|
||||
if str_key:
|
||||
col = columns[i]
|
||||
strings_per_lang[col['lang']][col['style']][name] = str
|
||||
strings_per_lang[col['lang']][col['style']][name] = str_key
|
||||
|
||||
# Create a folder for the imported language outfiles
|
||||
from pathlib import Path
|
||||
@@ -199,11 +199,11 @@ for i in range(1, numcols):
|
||||
comm = ''
|
||||
if lang != 'en' and 'en' in strings_per_lang:
|
||||
en = strings_per_lang['en']
|
||||
if name in en[style]: str = en[style][name]
|
||||
elif name in en['Narrow']: str = en['Narrow'][name]
|
||||
if str:
|
||||
if name in en[style]: str_key = en[style][name]
|
||||
elif name in en['Narrow']: str_key = en['Narrow'][name]
|
||||
if str_key:
|
||||
cfmt = '%%%ss// %%s' % (50 - len(val) if len(val) < 50 else 1)
|
||||
comm = cfmt % (' ', str)
|
||||
comm = cfmt % (' ', str_key)
|
||||
|
||||
# Write out the string definition
|
||||
f.write(lstr_fmt % (name, val, comm))
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# marlang.py
|
||||
# languageUtil.py
|
||||
#
|
||||
|
||||
# A dictionary to contain language names
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# Usage: rle16_compress_cpp_image_data.py INPUT_FILE.cpp OUTPUT_FILE.cpp
|
||||
#
|
||||
import sys,struct
|
||||
import sys, struct
|
||||
import re
|
||||
|
||||
def addCompressedData(input_file, output_file):
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Usage: rle_compress_bitmap.py INPUT_FILE OUTPUT_FILE
|
||||
#
|
||||
import sys,struct
|
||||
import sys, struct
|
||||
import re
|
||||
|
||||
def addCompressedData(input_file, output_file):
|
||||
|
@@ -1,11 +1,6 @@
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import random
|
||||
import serial
|
||||
|
||||
Import("env")
|
||||
import argparse, sys, os, time, random, serial
|
||||
from SCons.Script import DefaultEnvironment
|
||||
env = DefaultEnvironment()
|
||||
|
||||
import MarlinBinaryProtocol
|
||||
|
||||
|
Reference in New Issue
Block a user