Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameter --image doesn't work #8

Closed
jans-de opened this issue Jan 27, 2021 · 3 comments
Closed

parameter --image doesn't work #8

jans-de opened this issue Jan 27, 2021 · 3 comments
Labels
question Further information is requested

Comments

@jans-de
Copy link

jans-de commented Jan 27, 2021

version: 1.0.2

IS:
calling wifi-password with -i or --image shows the password in the terminal.

SHOULD:
show the qr code as an image

SUGGESTION:
let the user specify a name and/or a path including the file extension(.jpeg, .png, etc.). If no extension is give or the extension is invalid, fall back to a default extension.

[janst@jan-pc wifi-password]$ wifi-password -i
ERROR: You need to run '/usr/bin/wifi-password' as root

[janst@jan-pc wifi-password]$ wifi-password --image
ERROR: You need to run '/usr/bin/wifi-password' as root

[janst@jan-pc wifi-password]$ sudo wifi-password -i
<shows password, erased for privacy reasons>

[janst@jan-pc wifi-password]$ sudo wifi-password --image
<shows password, erased for privacy reasons>```
@littlediobolic
Copy link
Contributor

littlediobolic commented Jan 27, 2021

     if args.qrcode:
         args.no_password = True
         generate_qr_code(args.ssid, password, image=args.image)
         return

Problem seems to be here. the -i switch will only be checked and the image var set if the -q switch is also selected. If you pass both -q and -i it should write the file.

@sdushantha sdushantha added the question Further information is requested label Jan 27, 2021
@n3rdly
Copy link

n3rdly commented Jan 27, 2021

I am also getting an error when I pass both flags

wifi-password -i -q                                                                                                                                                                  1 ↵ n3rdly@private
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/qrcode-6.1-py3.9.egg/qrcode/image/pil.py", line 6, in <module>
    from PIL import Image, ImageDraw
ModuleNotFoundError: No module named 'PIL'

> During handling of the above exception, another exception occurred:

> Traceback (most recent call last):
File "/usr/local/bin/wifi-password", line 33, in <module>
sys.exit(load_entry_point('wifi-password==1.0.3', 'console_scripts', 'wifi-password')())
  File "/usr/local/lib/python3.9/site-packages/wifi_password-1.0.3-py3.9.egg/wifi_password/wifi_password.py", line 108, in main
  File "/usr/local/lib/python3.9/site-packages/wifi_password-1.0.3-py3.9.egg/wifi_password/wifi_password.py", line 85, in generate_qr_code
  File "/usr/local/lib/python3.9/site-packages/qrcode-6.1-py3.9.egg/qrcode/main.py", line 289, in make_image
    from qrcode.image.pil import PilImage
  File "/usr/local/lib/python3.9/site-packages/qrcode-6.1-py3.9.egg/qrcode/image/pil.py", line 8, in <module>
    import Image
ModuleNotFoundError: No module named 'Image'


@tektaxi
Copy link

tektaxi commented Jan 28, 2021

@n3rdly same thing happened to me. Seems like the image module isn't bundled with the program. But you can just run pip3 install image and it fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants