mirror of
https://github.com/aclist/dztui.git
synced 2024-12-29 13:52:03 +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"
|
printf "[%s] [%s] %s\n" "$date" "$tag" "$string" >> "$debug_log"
|
||||||
}
|
}
|
||||||
check_pyver(){
|
check_pyver(){
|
||||||
pyver=$(python3 --version | awk '{print $2}')
|
local pyver=$(python3 --version | awk '{print $2}')
|
||||||
if [[ -z $pyver ]] || [[ ${pyver:0:1} -lt 3 ]]; then
|
local minor=$(<<< $pyver awk -F. '{print $2}')
|
||||||
warn "Requires python >=3.0" &&
|
if [[ -z $pyver ]] || [[ ${pyver:0:1} -lt 3 ]] || [[ $minor -lt 10 ]]; then
|
||||||
|
warn "Requires python >=3.10" &&
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -2003,7 +2004,7 @@ fetch_dzq(){
|
||||||
curl -Ls "$url" > $helpers_path/a2s/$repo.py
|
curl -Ls "$url" > $helpers_path/a2s/$repo.py
|
||||||
}
|
}
|
||||||
fetch_query(){
|
fetch_query(){
|
||||||
local sum="d52ff070b5bb36ace2fce2d914479f47"
|
local sum="7cbae12ae68b526e7ff376b638123cc7"
|
||||||
local file="$helpers_path/query.py"
|
local file="$helpers_path/query.py"
|
||||||
if [[ -f $file ]] && [[ $(md5sum $file | awk '{print $1}') == $sum ]]; then
|
if [[ -f $file ]] && [[ $(md5sum $file | awk '{print $1}') == $sum ]]; then
|
||||||
return
|
return
|
||||||
|
@ -2078,6 +2079,7 @@ steam_deps(){
|
||||||
initial_setup(){
|
initial_setup(){
|
||||||
echo "# Initial setup"
|
echo "# Initial setup"
|
||||||
run_depcheck
|
run_depcheck
|
||||||
|
check_pyver
|
||||||
watcher_deps
|
watcher_deps
|
||||||
check_architecture
|
check_architecture
|
||||||
check_version
|
check_version
|
||||||
|
|
|
@ -40,16 +40,12 @@ def get_rules(ip, qport):
|
||||||
except:
|
except:
|
||||||
sys.exit(1)
|
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]
|
ip = sys.argv[1]
|
||||||
qport = sys.argv[2]
|
qport = sys.argv[2]
|
||||||
mode = sys.argv[3]
|
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