rockymeza/wifi

print_table crashes because of numeric data

Closed this issue · 1 comments

The matrix of values fed to print_table by scan_command has a numeric column that it can't handle.

Traceback (most recent call last):
  File "/home/ubuntu/.virtualenvs/wifi/bin/wifi", line 7, in <module>
    execfile(__file__)
  File "/home/ubuntu/src/wifi/bin/wifi", line 153, in <module>
    args.func(args)
  File "/home/ubuntu/src/wifi/bin/wifi", line 47, in scan_command
    print_table([[cell.signal, cell.ssid, 'protected' if cell.encrypted else 'unprotected'] for cell in Cell.all(args.interface)])
  File "/home/ubuntu/src/wifi/wifi/utils.py", line 28, in print_table
    lengths = [max(map(len, column)) for column in zip(*matrix)]
TypeError: object of type 'int' has no len()

@DanLipsitt, hey thanks so much! I had a fix for this a while ago, but I couldn't get the tests to pass on both Python 2 and 3. I just sort of forgot about it.

I got it working and pushed out a release (0.2.1). You can install it off of PyPI now.

Please let me know if you run into any other problems. I hope that you can end up using wifi!