-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
executable file
·49 lines (38 loc) · 1.22 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import annotations
import sys
if sys.version_info < (3, 8):
message = (
"The Python version "
+ ".".join(map(str, sys.version_info[:3]))
+ " is not supported.\n"
+ "Use Python 3.8 or newer."
)
try:
import tkinter
except ImportError:
input(message) # wait for the user to see the text
else:
print(message, file=sys.stderr)
import tkinter.messagebox
_root = tkinter.Tk()
_root.withdraw()
tkinter.messagebox.showerror(title="Outdated Python", message=message)
_root.destroy()
exit(1)
if __name__ == "__main__":
try:
from pycatsearch import main
except ImportError:
__author__ = "StSav012"
__original_name__ = "py" "cat" "search"
try:
from updater import update_with_pip
update_with_pip(__original_name__)
from pycatsearch import main
except ImportError:
from updater import update_with_pip, update_from_github, update_with_git
update_with_git() or update_from_github(__author__, __original_name__)
from src.pycatsearch import main
main()