news update
All checks were successful
Modelari site build and deploy / Build-site (push) Successful in 19s
All checks were successful
Modelari site build and deploy / Build-site (push) Successful in 19s
This commit is contained in:
15
edit.py
15
edit.py
@@ -3,10 +3,23 @@ from tkinter import messagebox
|
|||||||
from tkinter import filedialog
|
from tkinter import filedialog
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
from git import Repo
|
||||||
|
|
||||||
|
PATH_OF_GIT_REPO = r'.git'
|
||||||
|
COMMIT_MESSAGE = 'news update'
|
||||||
HTML_INSERT_TAG = "<!-- INSERT HERE -->"
|
HTML_INSERT_TAG = "<!-- INSERT HERE -->"
|
||||||
uploaded_image_path = None # Global to track uploaded image
|
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():
|
def upload_image():
|
||||||
global uploaded_image_path
|
global uploaded_image_path
|
||||||
path = filedialog.askopenfilename(
|
path = filedialog.askopenfilename(
|
||||||
@@ -94,6 +107,8 @@ def submit_content():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
messagebox.showerror("Error", str(e))
|
messagebox.showerror("Error", str(e))
|
||||||
|
|
||||||
|
git_push()
|
||||||
|
|
||||||
|
|
||||||
# GUI Setup
|
# GUI Setup
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
|
|||||||
@@ -30,6 +30,12 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<!-- INSERT HERE -->
|
<!-- INSERT HERE -->
|
||||||
|
|
||||||
|
<li><i>17.7.2025</i></li>
|
||||||
|
<li><b>Tabor pokracuje</b></li>
|
||||||
|
<li>jen máme déšť</li>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
<li><i>16.7.2025</i></li>
|
<li><i>16.7.2025</i></li>
|
||||||
<li><b>Spuštění stránek</b></li>
|
<li><b>Spuštění stránek</b></li>
|
||||||
<li>Slavnostně oznamujeme spuštění kroužkových stránek</li>
|
<li>Slavnostně oznamujeme spuštění kroužkových stránek</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user