Skip to content

Commit

Permalink
Exclude tests from coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
btimby committed Jan 5, 2022
1 parent 9b35957 commit 528969e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
include=pywpas/*
30 changes: 24 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:target: https://badge.fury.io/py/pywpas

pywpas
==================
======

A python library to control wpa_supplicant via it's control socket.

Expand All @@ -17,7 +17,8 @@ Installation

``pip install pywpas``

Example:
Example
-------

.. code-block:: python
Expand Down Expand Up @@ -47,9 +48,20 @@ Example:
for network in scan_results:
print(network.ssid, network.signal_level)
# You can connect to a network:
# You can connect to a network (implictly adds a profile):
interface.connect(scan_results[0])
# Write the network to the wpa_supplicant.conf file:
interface.save_config()
# Then disconnect...
interface.disconnect()
# and remove the network:
interface.del_network(scan_results[0])
interface.save_config()
# You can also add a profile (without connecting):
interface.add_network(scan_results[0])
# And save it:
interface.save_config()
# You can define a network and connect to it:
network = pywpas.Network(ssid='FOOBAR', ...)
Expand All @@ -58,10 +70,13 @@ Example:
# There is a high-level scan function, it will invoke callback
# with each unique network found during the scan timeout duration:
pywpas.scan(interface, lambda network: print(network.ssid), timeout=30.0)
scan = interface.background_scan(lambda network: print(network.ssid),
timeout=30.0)
time.sleep(5.0)
scan.stop()
wpa_supplicant
--------------
wpa_supplicant configuration
----------------------------
You must configure wpa_supplicant to open a control socket. Optionally you can
enable config file writing.
Expand All @@ -71,6 +86,9 @@ enable config file writing.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=nobody
update_config=1
Event with an emtpy configuation (no networks) you can use this library to add
networks, connect to networks and save the profiles to the configuration file.
Development
-----------
Expand Down

0 comments on commit 528969e

Please sign in to comment.