-
Notifications
You must be signed in to change notification settings - Fork 0
/
script copy.py
50 lines (34 loc) · 10.7 KB
/
script copy.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
import requests as rq
from pathlib import Path
import base64
import tkinter as tk
from tkinter import ttk
import json
url = "https://raw.githubusercontent.com/SzczurekYT/Magnolie-Client/main/versions.json"
remVersion = rq.get(url).json()["script"].split(".")
file = Path(".\\").parent / "versions.json"
locVersion: str
with open(file, "r+") as f:
locVersion = json.load(f)["script"].split(".")
print(locVersion)
def install():
# Do something
if remVersion[2] > locVersion[2]:
# Download new version
print("Installing new version")
win = tk.Tk()
bstring = "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAHYAAAB2AH6XKZyAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAHGVJREFUeJztXXd8E0f2f6suWZItyd1ywR0LsAGDwaaY3gIEEjhaOAikXEI6HEfKLz25ENJIvXA/EhJylCSUEBISivlBgNBtYgewwRiwwb3LVt35/SHJXq3aarUq9vHNh1i7O/Nmdt933rz3ZqQFuIM7uIM7uIP/UmD+7kAgYkbSjOS7IiZNjBXFqIJ5IekhPGkfNsbmWK63GtrURmS80dDZUHawumDDuyUfFvmzv57gDgHMmJ08W3mPcsaSZHGfacmSpEFyvpxHpV69pkF9rO73TZsu/ed/dlbtbPB2P5lGIBEAWzflzQVDowfNFHKEg8RcMbdN01p+vbnyty0lOz7ZcXHHbW80Oi9tXvQ85T3PDQ0dtChKGCWlK6ek+eLFnRV7Hnmh8KXDDHbP6wgIAjwz8rGM6enTPhgRN3w8G2MDIADAwfQXAVQ0Xa8+cO3wBw/sefQt81lGsH7YO0vuip3yep+ghGgm5FV31DRur/hu+ROnVu1kQp4vwPZ3B96bsW72ksELt2ZG9c9kYSzTSZKKQwQh4qzw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pdyMZ+RuN8ZMAzrGu2oyxSA6S2u5r8AAGIBNxmx4dfLlc1V3u6TPxBQFmB6dvKLCWGSVF+152rnMGAAIh6bq4oKftBXffI1AsYCLMlPzx/bP/p9Hoftw7eYYNBtBsyv6iUYA8s5EZedbNSjPWU1rbW+65tvEBAWQKlUCnNSI94WC3g+3YmDEeI+Z18jkwbxJZlJihd82TdfISAswIoJKa9lJ4XN9Wcf7I18ojMgC+KnYyys8GJls80r4nsy/G4BFo9LGzMkKWyFv9qnunOYz2WzB8crnlUB8PzVV2/ArxYgPyEhZFqOcltkiJsbPb0FUgQACHV9BAQgE/OVnGAR6+TVukN+6Z8X4FcCLJ+a9nn/OAX9V8YzBltnEIiRIYEQwRLeECGbe7ykqqnCp130Evz23sC7hyQsiQgWjL5Zrw6It3EihANCCBAgMOIIcASAcASAEOBgeoO4EeEACIFczH0eAI4BgM7f/fYU/w83sVEwvbvArQAAAABJRU5ErkJggg=="
icon = tk.PhotoImage(data=base64.b64decode(bstring))
win.title("Magnolie")
win.wm_iconphoto(True, icon)
ws = win.winfo_screenwidth() # width of the screen
hs = win.winfo_screenheight() # height of the screen
# Set window initial height and width
height = hs / 2
width = ws / 2
# calculate x and y coordinates for the Tk root window
x = (ws / 2) - (width / 2)
y = (hs / 2) - (height / 2)
win.geometry("%dx%d+%d+%d" % (width, height, x, y))
button = ttk.Button(text="Instaluj", command=install)
win.mainloop()