updated functions.py to keep tabs
All checks were successful
Publish Docker image / Push Docker image to Docker Hub (push) Successful in 1s

This commit is contained in:
2025-09-24 07:44:27 +02:00
parent 4bcec44d05
commit 7f6665d3e1

View File

@@ -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