mirror of
https://github.com/aclist/dztui.git
synced 2024-12-28 13:22:35 +01:00
fix: enforce python 3.10
This commit is contained in:
parent
98217f6bcb
commit
6beca3a6d0
2 changed files with 11 additions and 13 deletions
10
dzgui.sh
10
dzgui.sh
|
@ -316,9 +316,10 @@ logger(){
|
|||
printf "[%s] [%s] %s\n" "$date" "$tag" "$string" >> "$debug_log"
|
||||
}
|
||||
check_pyver(){
|
||||
pyver=$(python3 --version | awk '{print $2}')
|
||||
if [[ -z $pyver ]] || [[ ${pyver:0:1} -lt 3 ]]; then
|
||||
warn "Requires python >=3.0" &&
|
||||
local pyver=$(python3 --version | awk '{print $2}')
|
||||
local minor=$(<<< $pyver awk -F. '{print $2}')
|
||||
if [[ -z $pyver ]] || [[ ${pyver:0:1} -lt 3 ]] || [[ $minor -lt 10 ]]; then
|
||||
warn "Requires python >=3.10" &&
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
@ -2003,7 +2004,7 @@ fetch_dzq(){
|
|||
curl -Ls "$url" > $helpers_path/a2s/$repo.py
|
||||
}
|
||||
fetch_query(){
|
||||
local sum="d52ff070b5bb36ace2fce2d914479f47"
|
||||
local sum="7cbae12ae68b526e7ff376b638123cc7"
|
||||
local file="$helpers_path/query.py"
|
||||
if [[ -f $file ]] && [[ $(md5sum $file | awk '{print $1}') == $sum ]]; then
|
||||
return
|
||||
|
@ -2078,6 +2079,7 @@ steam_deps(){
|
|||
initial_setup(){
|
||||
echo "# Initial setup"
|
||||
run_depcheck
|
||||
check_pyver
|
||||
watcher_deps
|
||||
check_architecture
|
||||
check_version
|
||||
|
|
|
@ -40,16 +40,12 @@ def get_rules(ip, qport):
|
|||
except:
|
||||
sys.exit(1)
|
||||
|
||||
def switch(case):
|
||||
if case == "info":
|
||||
get_info(ip, qport)
|
||||
elif case == "rules":
|
||||
get_rules(ip, qport)
|
||||
else:
|
||||
sys.exit(1)
|
||||
|
||||
ip = sys.argv[1]
|
||||
qport = sys.argv[2]
|
||||
mode = sys.argv[3]
|
||||
|
||||
switch(mode)
|
||||
match mode:
|
||||
case "info":
|
||||
get_info(ip, qport)
|
||||
case "rules":
|
||||
get_rules(ip, qport)
|
||||
|
|
Loading…
Reference in a new issue