From 81f0f8de331b382caad8e82348a3ccbac5bb150e Mon Sep 17 00:00:00 2001 From: jakobst1n Date: Fri, 20 Oct 2023 19:35:32 +0200 Subject: Run black, and do some changes for enabling better syntax expandability --- src/journal_lib/parse/preprocessing.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/journal_lib/parse/preprocessing.py') diff --git a/src/journal_lib/parse/preprocessing.py b/src/journal_lib/parse/preprocessing.py index 6d4a0cf..a9ca676 100644 --- a/src/journal_lib/parse/preprocessing.py +++ b/src/journal_lib/parse/preprocessing.py @@ -1,6 +1,7 @@ import re from pathlib import Path + def preprocess_includes(filepath: Path): """ Reads the file at 'filepath', processing any "include" directives, @@ -8,10 +9,10 @@ def preprocess_includes(filepath: Path): This does not report circular includes, so that would become a infinite loop """ - INCLUDE_RE = re.compile(r'^\s*include\s+([^\n]+)\s*$', re.IGNORECASE) + INCLUDE_RE = re.compile(r"^\s*include\s+([^\n]+)\s*$", re.IGNORECASE) def read_file(file_path): - with open(file_path, 'r') as file: + with open(file_path, "r") as file: return file.readlines() lines = read_file(filepath) @@ -21,8 +22,8 @@ def preprocess_includes(filepath: Path): if match: included_file_path = match.group(1) included_lines = read_file(included_file_path) - lines[i:i+1] = included_lines + lines[i : i + 1] = included_lines else: i += 1 - return ''.join(lines) + return "".join(lines) -- cgit v1.2.3