From 7f6665d3e102f09d88cb53829c34ee9cdfb0c874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Tr=C3=B6ger?= Date: Wed, 24 Sep 2025 07:44:27 +0200 Subject: [PATCH] updated functions.py to keep tabs --- src/functions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/functions.py b/src/functions.py index 7e1589e..367ec09 100755 --- a/src/functions.py +++ b/src/functions.py @@ -6,9 +6,9 @@ import pdfplumber -def convert(file_path=False): +def convert(file_path:str=""): """Opens pdf and converts it into text""" - if not file_path: + if file_path == "": # if there is no server to provide a filepath, open filepath dialog import tkinter as tk from tkinter import filedialog @@ -62,7 +62,7 @@ def convert_text(text: str): indent_level = len(tabStops) if indented_points and indent_level == len(tabStops): - line, num = re.subn("\t+(.)(..*)", rf"\1 {{{{c{field_nr}::\2}}}}", line) + line, num = re.subn("(\t+.)(..*)", rf"\1 {{{{c{field_nr}::\2}}}}", line) if num > 0: changed_lines.append(line) continue