From 646ba6ea4db00c92b1f5f17a361872bed826bc5f Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 17 Jul 2024 00:17:05 +0900 Subject: [PATCH] black --- code-generator/my_mod/tlm_def.py | 23 ++++++++++++++++++++--- code-generator/my_mod/util.py | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/code-generator/my_mod/tlm_def.py b/code-generator/my_mod/tlm_def.py index 7940c18a..c1a041d8 100644 --- a/code-generator/my_mod/tlm_def.py +++ b/code-generator/my_mod/tlm_def.py @@ -64,7 +64,14 @@ def GenerateTlmDef(settings, tlm_db): # tlm field のバリデーション if not my_mod.util.ValidateTlmField(name): - print("Error: Tlm Field must match `[A-Z_][0-9A-Z_]*` at " + name + " in " + tlm["tlm_name"].upper() + ".", file=sys.stderr) + print( + "Error: Tlm Field must match `[A-Z_][0-9A-Z_]*` at " + + name + + " in " + + tlm["tlm_name"].upper() + + ".", + file=sys.stderr, + ) sys.exit(1) pos = int(pos) @@ -95,10 +102,20 @@ def GenerateTlmDef(settings, tlm_db): func_code += "TF_copy_double" max_pos = pos + 8 elif var_type == "raw": - print("Error: Var. Type `raw` of " + name + " is forbidden in Telemetry Generator at " + tlm["tlm_name"].upper() + ".", file=sys.stderr) + print( + "Error: Var. Type `raw` of " + + name + + " is forbidden in Telemetry Generator at " + + tlm["tlm_name"].upper() + + ".", + file=sys.stderr, + ) sys.exit(1) else: - print("Error: Tlm DB Err at " + name + " in " + tlm["tlm_name"].upper() + ".", file=sys.stderr) + print( + "Error: Tlm DB Err at " + name + " in " + tlm["tlm_name"].upper() + ".", + file=sys.stderr, + ) sys.exit(1) func_code += "(&packet[" + str(pos) + "], " + code + ");\n" diff --git a/code-generator/my_mod/util.py b/code-generator/my_mod/util.py index f20705bd..1a969bba 100644 --- a/code-generator/my_mod/util.py +++ b/code-generator/my_mod/util.py @@ -11,8 +11,8 @@ def ValidateTlmField(name): - pattern = re.compile(r'[A-Z_][0-9A-Z_]*') - parts = name.split('.') + pattern = re.compile(r"[A-Z_][0-9A-Z_]*") + parts = name.split(".") return all(pattern.fullmatch(part) for part in parts)