Giter VIP home page Giter VIP logo

python-iwlib's People

Contributors

flacjacket avatar hitochan777 avatar jpopelka avatar nathantypanski avatar nhoad 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-iwlib's Issues

tagged release

Could you tag a new release?
I'd like to package 1.6.

1.7.0: Missing include during test?

Hi!

I'm currently trying to package 1.7.0 for the official repositories on Arch Linux.

Build seems to succeed, but when running the tests

  local _py3_ver=$(python3 -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor))")
  export PYTHONPATH="build/lib.linux-$CARCH-${_py3_ver}/:${PWD}:${PYTHONPATH}"
  py.test

I get:

============================= test session starts ==============================                                                        
platform linux -- Python 3.8.0, pytest-5.3.1, py-1.8.0, pluggy-0.13.1                                                                   
rootdir: /build/python-iwlib/src/iwlib-1.7.0           
collected 2 items        
                                                                                                                                                                                                                                                                                 
test/test_imports.py FF                                                  [100%]                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                 
=================================== FAILURES ===================================                                                                                                                                                                                                 
____________________________ test_imports_dont_fail ____________________________                                                        
                                                                    
    def test_imports_dont_fail():                      
        '''Gross test for ensuring packaging hasn't been broken.''' 
        imports = [                                                                                                                     
            "iwlib.iwconfig.get_iwconfig",                                                                                              
            "iwlib.iwlist.scan",         
            "iwlib.utils.get_max_quality",                                                                                              
            "iwlib.utils.set_essid",                                
            "iwlib.utils.supports_scanning",                 
        ]                                                                                                                               
                                                             
        for imp in imports:                                         
            module, _from = imp.rsplit('.', 1)                     
            print('from %s import %s' % (module, _from))                                                                                
>           __import__(module, fromlist=[_from])         
                                                                    
test/test_imports.py:16:                                        
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _                                                                                                                                                                                                  
iwlib/__init__.py:2: in <module>                                                                                                                                                                                                                                                 
    from .iwconfig import get_iwconfig                                                                                                                                                                                                                                           
iwlib/iwconfig.py:18: in <module>                                                                                                       
    from .utils import _parse_stats, _get_bytes, iwlib_socket
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
                                                                                                                                        
    import contextlib                       
    import errno                       
    import os                                                       
                                                                                                                                        
>   from ._iwlib import ffi, lib as iwlib                           
                                                                                                                                        
                                                                                                                                        
    @contextlib.contextmanager                                                                                                          
E   ModuleNotFoundError: No module named 'iwlib._iwlib'                                                                                 
                                                                    
iwlib/utils.py:19: ModuleNotFoundError                                                                                                  
----------------------------- Captured stdout call -----------------------------                                                        
from iwlib.iwconfig import get_iwconfig                                                                                                                                                                                                                                          
_________________________ test_backwards_compatibility _________________________                                                        
                                                                    
    def test_backwards_compatibility():                                                                                                 
        '''Ensure backwards compatibility with the module before I came along.'''                                                       
>       from iwlib import get_iwconfig              
                                                                    
test/test_imports.py:21:                            
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _                                                         
iwlib/__init__.py:2: in <module>                         
    from .iwconfig import get_iwconfig                                                                                                  
iwlib/iwconfig.py:18: in <module>                                                                                                                                                                                                                                                
    from .utils import _parse_stats, _get_bytes, iwlib_socket                                                                                                                                                                                                                    
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                 
    import contextlib                                                                                                                   
    import errno                                                                                                                        
    import os                                                                                                                           
                                                                                                                                        
>   from ._iwlib import ffi, lib as iwlib   
                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                 
    @contextlib.contextmanager                                                                                                                                                                                                                                                   
E   ModuleNotFoundError: No module named 'iwlib._iwlib'             
                                                                                                                                        
iwlib/utils.py:19: ModuleNotFoundError                                                                                                  
============================== 2 failed in 0.06s ===============================                                                        

This might be a problem introduced with python3.8, but maybe you have an idea?

Doesnt install using pip.

In file included from iwlib/utils.c:17:0:
iwlib/utils.h:2:19: fatal error: iwlib.h: No such file or directory
 #include <iwlib.h>
                   ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-m7bch8bt/iwlib/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-k1x14wgz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-m7bch8bt/iwlib/

Difference in released tarballs between GitHUB and PyPi

There is difference between releases on GitHUB and PyPi.
tar.gz file on pypi.org https://pypi.org/project/iwlib/#files contains following directory structure:

./iwlib-1.6.1
./iwlib-1.6.1/iwlib
./iwlib-1.6.1/iwlib/__pycache__
./iwlib-1.6.1/iwlib/__pycache__/_cffi__x41597a6exaad18ffc.c
./iwlib-1.6.1/iwlib/__init__.py
./iwlib-1.6.1/iwlib/_fakeiwlib_build.py
./iwlib-1.6.1/iwlib/_iwlib_build.py
./iwlib-1.6.1/iwlib/iwconfig.py
./iwlib-1.6.1/iwlib/iwlist.py
./iwlib-1.6.1/iwlib/utils.py
./iwlib-1.6.1/iwlib.egg-info
./iwlib-1.6.1/iwlib.egg-info/PKG-INFO
./iwlib-1.6.1/iwlib.egg-info/SOURCES.txt
./iwlib-1.6.1/iwlib.egg-info/dependency_links.txt
./iwlib-1.6.1/iwlib.egg-info/not-zip-safe
./iwlib-1.6.1/iwlib.egg-info/requires.txt
./iwlib-1.6.1/iwlib.egg-info/top_level.txt
./iwlib-1.6.1/test
./iwlib-1.6.1/test/test_imports.py
./iwlib-1.6.1/AUTHORS
./iwlib-1.6.1/COPYING
./iwlib-1.6.1/MANIFEST.in
./iwlib-1.6.1/README.rst
./iwlib-1.6.1/setup.py
./iwlib-1.6.1/PKG-INFO
./iwlib-1.6.1/setup.cfg

And tar.gz file on GitHUB https://github.com/nathan-hoad/python-iwlib/releases contains:

./python-iwlib-1.6.1
./python-iwlib-1.6.1/.gitignore
./python-iwlib-1.6.1/AUTHORS
./python-iwlib-1.6.1/COPYING
./python-iwlib-1.6.1/MANIFEST.in
./python-iwlib-1.6.1/README.rst
./python-iwlib-1.6.1/iwlib
./python-iwlib-1.6.1/iwlib/__init__.py
./python-iwlib-1.6.1/iwlib/_iwlib_build.py
./python-iwlib-1.6.1/iwlib/iwconfig.py
./python-iwlib-1.6.1/iwlib/iwlist.py
./python-iwlib-1.6.1/iwlib/utils.py
./python-iwlib-1.6.1/setup.py
./python-iwlib-1.6.1/test
./python-iwlib-1.6.1/test/__init__.py
./python-iwlib-1.6.1/test/test_imports.py

Why PyPi version contains iwlib/_fakeiwlib_build.py and inside references to /usr/include/fakeiwlib.h?

get_iwconfig only returns the info of currently used AP

I don't know why but get_iwconfig only returns the info of currently used AP, where I am supposed to get multiple results.
Do you have any idea of why this is happening?

>>> iwlib.get_iwconfig("wlan0")
{'NWID': b'Auto', 'Frequency': b'5.24 GHz', 'Access Point': b'MAC_ADDRESS_HERE, 'BitRate': b'390 Mb/s', 'ESSID': b'ESSID_HERE', 'Mode': b'Managed', 'stats': {'quality': 42, 'level': 188, 'noise': 0, 'updated': 75}}

I confirmed there are multiple APs (16) detected with iw.
Is this somehow related to sudo privilege?

$ sudo iw wlan0 scan | grep "SSID:" | wc -l
16

Not show channel of AP!

Hi. iwlib show essential information... but lost the most important: the channel of AP.

It is possibie implement it?

Thanks

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.