From b0160f61fcbce9fee27dabdab540786f5701f904 Mon Sep 17 00:00:00 2001 From: Gorden Date: Fri, 30 Jul 2021 08:25:11 +0200 Subject: [PATCH] debug --- .vscode/settings.json | 3 +++ imgtank.py | 49 ++++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 24 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8c963f0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "C:\\Program Files\\Python38\\python.exe" +} \ No newline at end of file diff --git a/imgtank.py b/imgtank.py index 684c2a3..79e92e2 100644 --- a/imgtank.py +++ b/imgtank.py @@ -130,33 +130,34 @@ def click_b3(channel): main_fun(BTN2_PIN) def click_b2(channel): - global aplist - global idxWin - global idxLen global start global vert - global test - - start = time.time() - - if apIndx >= 0: - main_fun(998) - #print ''.join(pwdLst) #TODO change password for real... - start = stamp - SCREEN_SAVER + 5 + global apIndx + global chaSel + if state == BTN3_PIN: + apIndx = -1 + if vert == 1: + if horz == 1: + main_fun(995) + os.system("# enable hotspot") + else: + main_fun(996) + os.system("# disable hotspot") + elif vert == 2: + main_fun(997) + os.system("") + start = stamp - SCREEN_SAVER + 5 + else: + main_fun(BTN1_PIN) else: - result = os.popen("iwlist {0} scan 2>/dev/null | grep '^..*ESSID:\"..*\"$' | sed 's/^.*ESSID:\"\\(..*\\)\".*$/\\1/'".format(iface)).read() - aplist = result.splitlines() - - idxLen = len(aplist) - if (idxWin + SCREEN_LINES) > idxLen: - idxWin = idxLen - SCREEN_LINES - if idxWin < 0: - idxWin = 0 - - if vert > idxLen: - vert = idxLen - - main_fun(channel) + if apIndx < 0: + vert = 3 # Default + main_fun(BTN3_PIN) + else: + if chaSel < 2: + chaSel = chaSel + 1 + pwdLst[horz] = choices[chaSel][vert] + main_fun(BTN2_PIN) def select_h(channel): global apIndx