1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +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 # 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 ## [4.0.2] 2023-11-22
## Fixed ## Fixed
- Query helper not loading: fixed a remote link pointing to the wrong destination and added a checksum verification to ensure file is present - 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 curl -Ls "$url" > $helpers_path/a2s/$repo.py
} }
fetch_query(){ 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 author="aclist"
local repo="dzgui" local repo="dzgui"
local url="https://raw.githubusercontent.com/$author/dztui/$repo/helpers/query.py" local url="https://raw.githubusercontent.com/$author/dztui/$repo/helpers/query.py"

View file

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