1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-28 05:12:36 +01:00

fix: backwards compatibility for pre 3.10 python3

This commit is contained in:
aclist 2023-11-23 12:45:02 +09:00
parent 8b2900e303
commit 2c41f5a10d
3 changed files with 17 additions and 6 deletions

View file

@ -1,5 +1,9 @@
# Changelog
## [4.0.3] 2023-11-22
## Fixed
- Query helper: backwards compatibility for pre-2021 versions of Python 3
## [4.0.2] 2023-11-22
## Fixed
- Query helper not loading: fixed a remote link pointing to the wrong destination and added a checksum verification to ensure file is present

View file

@ -2002,7 +2002,9 @@ fetch_dzq(){
curl -Ls "$url" > $helpers_path/a2s/$repo.py
}
fetch_query(){
[[ $(md5sum $helpers_path/query.py | awk '{print $1}') == "7cbae12ae68b526e7ff376b638123cc7" ]] && return
local sum="d52ff070b5bb36ace2fce2d914479f47"
local file="$helpers_path/query.py"
[[ -f $file ]] && [[ $(md5sum $file | awk '{print $1}') == $sum ]] && return
local author="aclist"
local repo="dzgui"
local url="https://raw.githubusercontent.com/$author/dztui/$repo/helpers/query.py"

View file

@ -40,11 +40,16 @@ 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]
match mode:
case "info":
get_info(ip, qport)
case "rules":
get_rules(ip, qport)
switch(mode)