Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
35 changes: 35 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Windows EXE

on:
push:
branches: [ main ]
workflow_dispatch: # manual trigger option

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r requirements.txt

- name: Build .exe with PyInstaller
run: |
pyinstaller --onefile --windowed --icon=assets/icon.ico --name="Dekont Sıralayıcı" gui.py

- name: Upload EXE artifact
uses: actions/upload-artifact@v4
with:
name: Dekont Sıralayıcı
path: "dist/Dekont Sıralayıcı.exe"
Binary file added __pycache__/main_logic.cpython-312.pyc
Binary file not shown.
23 changes: 8 additions & 15 deletions main_logic.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
import fitz
import pymupdf
import re
import os
import locale
import tempfile
from pypdf import PdfMerger, PdfReader, PdfWriter
from pypdf import PdfReader, PdfWriter

def merge_pdfs(pdf_files):
"""
Merges PDF files from a list of file paths and creates a temporary merged file

Args:
pdf_files: A list of paths to PDF files

Returns:
str: Path to the temporary merged PDF file
"""
merger = PdfMerger()
merge_writer = PdfWriter()

# Use the provided list of file paths directly instead of scanning a folder
for filepath in pdf_files:
merger.append(filepath)
reader = PdfReader(filepath)
for page in reader.pages:
merge_writer.add_page(page)

# Create a temporary file for the merged PDF
with tempfile.NamedTemporaryFile(delete=False, suffix="_merged.pdf") as temp_file:
temp_path = temp_file.name
merger.write(temp_file)
merge_writer.write(temp_file)

# Return the path to the temporary merged file
return temp_path
Expand All @@ -41,7 +34,7 @@ def find_name(text):
def page_traverse(pdf_path):
global pages
global_page_number = 0
doc = fitz.open(pdf_path)
doc = pymupdf.open(pdf_path)
pages = []
for page in doc:

Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tk
pypdf
pymupdf