Refactor
This commit is contained in:
parent
30bd30e038
commit
71c8ea7bbd
41 changed files with 375 additions and 284 deletions
|
|
@ -1,24 +0,0 @@
|
|||
from argparse import ArgumentParser
|
||||
|
||||
from utils import install_package
|
||||
|
||||
try:
|
||||
import qrcode
|
||||
except ImportError:
|
||||
install_package("qrcode[pil]")
|
||||
finally:
|
||||
import qrcode
|
||||
|
||||
|
||||
def main(args):
|
||||
img = qrcode.make(f"WIFI:S:{args.ssid};T:WPA;P:{args.passwd};;")
|
||||
img.save(args.output)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = ArgumentParser(prog="WiFi QR Generator", description="Creates QR Codes to join a Password Protected WiFi Network")
|
||||
parser.add_argument("ssid", help="The SSID of the WiFi Network to connect to")
|
||||
parser.add_argument("passwd", help="The passphrase of the WiFi Network to connect to")
|
||||
parser.add_argument("-o", "--output", required=True, help="Where to save the resulting image to")
|
||||
args = parser.parse_args()
|
||||
main(args)
|
||||
Loading…
Reference in a new issue