From 469686736ddd8acca92a1bfb4f8697c37ce2fd2f Mon Sep 17 00:00:00 2001 From: HellAholic Date: Tue, 25 Jun 2024 13:36:21 +0200 Subject: [PATCH 1/3] Add modifications to script, include a debug line --- .github/workflows/gcodeanalyzer.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gcodeanalyzer.yml b/.github/workflows/gcodeanalyzer.yml index 0b85fb75aa..8aa0f7d316 100644 --- a/.github/workflows/gcodeanalyzer.yml +++ b/.github/workflows/gcodeanalyzer.yml @@ -184,9 +184,16 @@ jobs: continue infilename = os.path.join(folder_path, filename) with open(infilename.rsplit(".", 1)[0] + ".time", "r") as f: - match = re.match(r"^.*?real\s+(\d+)m(\d+\.\d+)s", f.read()) - timer = 0 if not match else float(match[1]) - + content = f.read() + print("File content:", content) # Debug + match = re.match(r"^real\s+(\d+)m(\d+\.\d+)s", content, re.MULTILINE) + if match: + print("Match groups:", match.groups()) # Debugging line + timer = float(match.group(1)) * 60 + float(match.group(2)) + else: + print("No match found") # Debugging line + timer = 0 + frame = GCodeAnalyzer.DataFrame(infilename) line_lengths = frame.gc.extrusions['length'].describe() From fe774c506501ec508d180eabe9527e41d5986172 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Tue, 25 Jun 2024 14:58:51 +0200 Subject: [PATCH 2/3] User search instead of match :shrug: --- .github/workflows/gcodeanalyzer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gcodeanalyzer.yml b/.github/workflows/gcodeanalyzer.yml index 8aa0f7d316..22095303b5 100644 --- a/.github/workflows/gcodeanalyzer.yml +++ b/.github/workflows/gcodeanalyzer.yml @@ -186,7 +186,7 @@ jobs: with open(infilename.rsplit(".", 1)[0] + ".time", "r") as f: content = f.read() print("File content:", content) # Debug - match = re.match(r"^real\s+(\d+)m(\d+\.\d+)s", content, re.MULTILINE) + match = re.search(r"^real\s+(\d+)m(\d+\.\d+)s", content, re.MULTILINE) if match: print("Match groups:", match.groups()) # Debugging line timer = float(match.group(1)) * 60 + float(match.group(2)) From 0169a41cb84e29d90b9973936b94646a8569b06d Mon Sep 17 00:00:00 2001 From: HellAholic Date: Tue, 25 Jun 2024 16:06:57 +0200 Subject: [PATCH 3/3] Remove debug comments --- .github/workflows/gcodeanalyzer.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/gcodeanalyzer.yml b/.github/workflows/gcodeanalyzer.yml index 22095303b5..aa45e74bc2 100644 --- a/.github/workflows/gcodeanalyzer.yml +++ b/.github/workflows/gcodeanalyzer.yml @@ -185,13 +185,10 @@ jobs: infilename = os.path.join(folder_path, filename) with open(infilename.rsplit(".", 1)[0] + ".time", "r") as f: content = f.read() - print("File content:", content) # Debug match = re.search(r"^real\s+(\d+)m(\d+\.\d+)s", content, re.MULTILINE) if match: - print("Match groups:", match.groups()) # Debugging line timer = float(match.group(1)) * 60 + float(match.group(2)) else: - print("No match found") # Debugging line timer = 0 frame = GCodeAnalyzer.DataFrame(infilename)