Code Monkey home page Code Monkey logo

iw_parse's People

Contributors

cuzzo avatar damadmai avatar roramirez avatar spcampbell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

iw_parse's Issues

UserWarning during installation of version 0.0.3 causes ImportError while importing iw_parse

I am seeing an issue when I try to install the latest (0.0.3) version of the iw_parse package using pip.

# pip install iw_parse
Downloading/unpacking iw-parse
  Downloading iw_parse-0.0.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/iw-parse/setup.py) egg_info for package iw-parse
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)

Installing collected packages: iw-parse
  Running setup.py install for iw-parse
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)

Successfully installed iw-parse
Cleaning up...
# python
Python 2.7.6 (default, Nov 13 2018, 12:45:42)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import iw_parse
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named iw_parse

Raspberry Pi

On RPI 4, I am getting following error,

>>> get_interfaces()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/smartcar-app-v1/lib/iw_parse.py", line 336, in get_interfaces
    return get_parsed_cells(call_iwlist(interface).split('\n'))
TypeError: a bytes-like object is required, not 'str'

apparently the underlying call_iwlist is returning a byte object

>>> print(call_iwlist())
b'wlan0     Scan completed :\n          Cell 01 -...\n\n'

So to fix the issue I just updated the get_interfaces to decode the call_iwlist as following,

def get_interfaces(interface="wlan0"):
    """ Get parsed iwlist output
        @param string interface
            interface to scan
            default is wlan0

        @param list columns
            default data attributes to return

        @return dict
            properties: dictionary of iwlist attributes
    """
    return get_parsed_cells(call_iwlist(interface).decode().split('\n'))

Import error!!

ImportError: No module named 'iw_parse'
iw_parse cannot use in python 3.x now. Please do something. Although I already installed the module.



2019-03-24-024734_1920x1080_scrot
2019-03-24-024041_1920x1080_scrot

2019-03-24-023612_1920x1080_scrot (1)

Error

iwlist wlan0 scan | iw_parse
Traceback (most recent call last):
File "/usr/bin/iw_parse", line 5, in
from iw_parse.iw_parse import get_parsed_cells, print_cells
File "/usr/lib/python3.5/site-packages/iw_parse/iw_parse.py", line 141
print el,
^
SyntaxError: Missing parentheses in call to 'print'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.