-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
62 lines (48 loc) · 1.75 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/pythonpy
import tkinter as tk
from tkinter import messagebox as msg
import analyze_copy as ac
import important_functions as important_functions
from graphic_interface import *
import UPDATE_MODULE
import terminal
import os
imf= important_functions.important_func()
#info of version
date="2023-12-31"
name_app="HTML_updater"
GUI=True
file=None
file_name=""
contents=""
#update section-------------------------------------------------------------
UPDATE_MODULE.update_self(not GUI)
if GUI == True:
window = tk.Tk()
window.withdraw()
update_available=UPDATE_MODULE.update_check(date, name_app)
if update_available==None:
if GUI == False:
print("You don't have internet connection.")
else:
msg.showinfo(title=name_app, message="You don't have internet connection.")
elif update_available==True:
if GUI == False:
print("Update is available!")
ask=input("Do you want download it now (Y/n): ")
ask=ask.upper()
if ask=="Y":
if_download=UPDATE_MODULE.download_update_repo("https://codeload.github.com/wleng2001/HTML_updater/zip/refs/heads/main", os.getcwd())
if if_download==False:
print("Lost connection file wasn't downloaded")
else:
ask = msg.askquestion(title=name_app, message="Update is available!\nDownload it now?")
if ask == "yes":
if_download=UPDATE_MODULE.download_update_repo("https://codeload.github.com/wleng2001/HTML_updater/zip/refs/heads/main", os.getcwd())
if if_download==False:
msg.showinfo("Lost connection file wasn't download")
else:
print("App is current")
#work section---------------------------------------------------------------
if GUI==True:
graphic_mode(file_name)