forked from TowarzyszFatCat/doccli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
34 lines (26 loc) · 908 Bytes
/
run.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
from main_module import m_welcome
from requests import get
from termcolor import colored
import webbrowser
import threading
from discord_integration import start_rpc, set_running
import platform
import os
VERSION = "v2.9"
def check_update() -> None:
response = get(
"https://api.github.com/repos/TowarzyszFatCat/doccli/releases/latest"
)
if response.json()["name"] != VERSION:
print(colored("Wersja programu:", "white"), colored(VERSION, "red"))
print(colored('Najnowsza wersja:', "white"), colored(f"{response.json()['name']}", "green"))
print('')
print(colored("Dostępna jest nowa wersja doccli!", "white"))
print('')
input(colored("Naciśnij enter by pominąć...", "yellow"))
if __name__ == "__main__":
check_update()
set_running(True)
thread = threading.Thread(target=start_rpc)
thread.start()
m_welcome()