From 967457883a81e68d5ca36ca75f8e93b8f2e4b7a2 Mon Sep 17 00:00:00 2001 From: angoosh Date: Thu, 17 Jul 2025 11:07:53 +0200 Subject: [PATCH] news update --- edit.py | 15 +++++++++++++++ index.html | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/edit.py b/edit.py index c74b8da..544489a 100644 --- a/edit.py +++ b/edit.py @@ -3,10 +3,23 @@ from tkinter import messagebox from tkinter import filedialog import os import shutil +from git import Repo +PATH_OF_GIT_REPO = r'.git' +COMMIT_MESSAGE = 'news update' HTML_INSERT_TAG = "" uploaded_image_path = None # Global to track uploaded image +def git_push(): + try: + repo = Repo(PATH_OF_GIT_REPO) + repo.git.add(update=True) + repo.index.commit(COMMIT_MESSAGE) + origin = repo.remote(name='origin') + origin.push() + except: + messagebox.showerror("Git error", "Something went wrong while pushing to origin") + def upload_image(): global uploaded_image_path path = filedialog.askopenfilename( @@ -94,6 +107,8 @@ def submit_content(): except Exception as e: messagebox.showerror("Error", str(e)) + git_push() + # GUI Setup root = tk.Tk() diff --git a/index.html b/index.html index 89168a6..b65ff68 100644 --- a/index.html +++ b/index.html @@ -30,6 +30,12 @@