split wifi file and put into new folder structure
This commit is contained in:
parent
f9decf8a26
commit
51ed619e2f
2 changed files with 29 additions and 24 deletions
28
python/src/experimentation.py
Executable file
28
python/src/experimentation.py
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import sys
|
||||
from lib.wifi import get_wifi, connect
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("-j", "--json", help="just output current scanned wifi as json", action="store_true")
|
||||
args = ap.parse_args()
|
||||
|
||||
if args.json:
|
||||
print(get_wifi())
|
||||
else:
|
||||
my_dict = get_wifi()
|
||||
for element in my_dict:
|
||||
print(element)
|
||||
my_input = input("wifi_name: ")
|
||||
connect(my_input)
|
||||
except KeyboardInterrupt:
|
||||
print("")
|
||||
print(">>> Interrupted by user")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -27,7 +27,7 @@ def _startup_check():
|
|||
gathered_missing.append(binary)
|
||||
if gathered_missing:
|
||||
raise OSError("missing the following binaries: " + str(gathered_missing).strip("[]"))
|
||||
|
||||
_startup_check()
|
||||
|
||||
|
||||
def _split_blocks(text: str) -> list:
|
||||
|
@ -108,26 +108,3 @@ def connect(ssid: str) -> bool:
|
|||
return True
|
||||
|
||||
|
||||
def main():
|
||||
_startup_check()
|
||||
try:
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("-j", "--json", help="just output current scanned wifi as json", action="store_true")
|
||||
args = ap.parse_args()
|
||||
|
||||
if args.json:
|
||||
print(get_wifi())
|
||||
else:
|
||||
my_dict = get_wifi()
|
||||
for element in my_dict:
|
||||
print(element)
|
||||
my_input = input("wifi_name: ")
|
||||
connect(my_input)
|
||||
except KeyboardInterrupt:
|
||||
print("")
|
||||
print(">>> Interrupted by user")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue