[Python-modules-commits] [wifi-python] 01/07: New upstream version 0.8.0~rc1

Ethan Ward ethanward-guest at moszumanska.debian.org
Thu Aug 24 00:00:01 UTC 2017


This is an automated email from the git hooks/post-receive script.

ethanward-guest pushed a commit to branch master
in repository wifi-python.

commit fd0b2043f3e405be70fc0ebd6442399d18ece131
Author: Ethan Ward <ethan.ward at mycroft.ai>
Date:   Tue Aug 22 15:44:33 2017 -0500

    New upstream version 0.8.0~rc1
---
 .gitignore                         |   9 +
 .travis.yml                        |  14 ++
 CHANGES.rst                        |  33 +++
 Makefile                           |  13 ++
 PKG-INFO                           | 140 -----------
 README.rst                         |  18 +-
 docs/Makefile                      | 153 ++++++++++++
 docs/changelog.rst                 |   5 +
 docs/conf.py                       | 242 +++++++++++++++++++
 docs/index.rst                     |  68 ++++++
 docs/scanning.rst                  |  69 ++++++
 docs/wifi_command.rst              | 155 +++++++++++++
 setup.cfg                          |   5 -
 setup.py                           |  59 +++--
 tests/__init__.py                  |   0
 tests/bin/ppass.py                 |  15 ++
 tests/test_init.py                 |  22 ++
 tests/test_parsing.py              | 465 +++++++++++++++++++++++++++++++++++++
 tests/test_schemes.py              | 236 +++++++++++++++++++
 tests/test_utils.py                |  89 +++++++
 wifi.egg-info/PKG-INFO             | 140 -----------
 wifi.egg-info/SOURCES.txt          |  19 --
 wifi.egg-info/dependency_links.txt |   1 -
 wifi.egg-info/requires.txt         |   2 -
 wifi.egg-info/top_level.txt        |   1 -
 wifi/__main__.py                   |   2 +
 bin/wifi => wifi/cli.py            |  29 +--
 wifi/scan.py                       | 204 ++++++++++++++--
 wifi/scheme.py                     |  20 +-
 wifi/utils.py                      |  76 +++++-
 30 files changed, 1929 insertions(+), 375 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7a549cd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+*.pyc
+__pycache__
+*.egg*
+/build
+/dist
+/docs/_build
+tmp/
+.coverage
+htmlcov
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..08e6ce5
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,14 @@
+language: python
+python:
+  - "2.7"
+  - "3.4"
+  - "3.5"
+  - "3.6"
+# command to install dependencies
+before_install:
+  - sudo apt-get install wireless-tools
+install:
+  - sudo python setup.py -q install
+# command to run tests
+script: sudo python setup.py test
+dist: trusty
diff --git a/CHANGES.rst b/CHANGES.rst
index b6c4d9a..c4740f3 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,6 +1,39 @@
 Changelog
 =========
 
+0.8.0rc1
+^^^^^^^^
+:release-date: 2017-08-07
+
+- Add support for sudo
+- Change default command name to `pywifi`, to evade conflicts with other packages
+- Add attribute `frequency_norm` which is the normalized frequency, aka frequency band
+  as one would find on packaging of WiFi hardware. Only 2.4Ghz and 5Ghz bands are
+  supported.
+- Fix some typo's in this document and create some more (probably)
+
+0.4.0
+^^^^^
+:release-date: 2017-07-17
+
+- Internal release only
+- Make the wifi command name configurable (#55 - thanks yourealwaysbe)
+- Add a __main__.py so that wifi can be invoked using python -mwifi
+- Fix argument parsing so that scan is the default argument even with options passed
+- Add preliminary EAP support (#63 - thanks irgusite)
+- Update test suite and overall PEP8 formatting
+- Fix WPA detection
+- Fix relative signal level parsing to not rely on stable dictionary order
+- Centralize code to reformat a passphrase to a psk
+- Add ability to generate a `wpa_supplicant` network configuration from a cell
+- Add parsing for:
+  - Group cipher
+  - Pairwise ciphers
+  - Authentication suites
+  Please note that it's likely to be refactored into a separate object, as more then
+  one of these triplets may exist for a given cell.
+- Add logging
+
 0.3.8
 ^^^^^
 :release-date: 2016-03-11
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b0c3de3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,13 @@
+PORT?=8008
+
+test:
+	python setup.py test
+
+docs:
+	cd docs && $(MAKE) html
+
+docs-server: docs
+	(sleep 1 && sensible-browser "http://localhost:$(PORT)")
+	cd docs/_build/html/ && python -m SimpleHTTPServer $(PORT)
+
+.PHONY: test docs docs-server
diff --git a/PKG-INFO b/PKG-INFO
deleted file mode 100644
index b578bd1..0000000
--- a/PKG-INFO
+++ /dev/null
@@ -1,140 +0,0 @@
-Metadata-Version: 1.1
-Name: wifi
-Version: 0.3.8
-Summary: 
-Command line tool and library wrappers around iwlist and
-/etc/network/interfaces.
-
-Home-page: UNKNOWN
-Author: Rocky Meza, Gavin Wahl
-Author-email: rockymeza at gmail.com
-License: BSD
-Description: wifi
-        ----
-        
-        Wifi provides a command line wrapper for iwlist and /etc/network/interfaces
-        that makes it easier to connect the WiFi networks from the command line.  The
-        wifi command is also implemented as a library that can be used from Python.
-        
-        ::
-        
-            # pip install wifi
-            # wifi --help
-        
-        
-        .. image:: https://travis-ci.org/rockymeza/wifi.png?branch=master
-           :target: https://travis-ci.org/rockymeza/wifi
-        
-        The documentation for wifi lives at https://wifi.readthedocs.org/en/latest/.
-        
-        
-        Changelog
-        =========
-        
-        0.3.8
-        ^^^^^
-        :release-date: 2016-03-11
-        
-        - Parse noise level if available (#91 - thanks zgoda-mobica)
-        
-        0.3.7
-        ^^^^^
-        :release-date: 2016-03-11
-        
-        - Fix bugs related to scheme parsing (#59, #42)
-        
-        0.3.6
-        ^^^^^
-        :release-date: 2016-02-11
-        
-        - Set all attributes to None in Cell.__init__ (#88 - thanks stvad)
-        
-        0.3.5
-        ^^^^^
-        :release-date: 2016-01-24
-        
-        - Better password handling (#62 - thanks foosel)
-        - Account for Cells with no SSID (#86 - thanks tlau)
-        
-        0.3.4
-        ^^^^^
-        :release-date: 2014-09-02
-        
-        - Fixed installation missing some files (#48 - thanks luckydonald)
-        
-        0.3.3
-        ^^^^^
-        :release-date: 2014-08-31
-        
-        - Check for write access for bashcompletion via os.access (#41, #47 - thanks foosel and jegger)
-        - Fixed scanning when quality is reported absolutely (#45 - jeromelebel)
-        - Fixed channel parsing (#33, #39 - thanks gavinwahl and qizha)
-        
-        0.3.2
-        ^^^^^
-        :release-date: 2014-07-26
-        
-        - Only run if __name__ == '__main__' (#29 - thanks Jonwei)
-        - Try to connect to the nearest Access Point
-        - wifi scan was failing when Bit Rate was the last line of output (#42 - thanks jargij)
-        - Added documentation for signal and quality on Cell
-        
-        0.3.1
-        ^^^^^
-        :release-date: 2014-02-10
-        
-        - Scheme.activate was failing on a TypeError in Python3
-        
-        0.3.0
-        ^^^^^
-        :release-date: 2014-02-09
-        
-        - Scheme.activate now throws a ConnectionError if activation failed (#17 - thanks alexykot)
-        - Cell.all now throws an InterfaceError if scanning failed (#18 - thanks alexykot)
-        - Better error message when scheme isn't found (#19 - thanks gavinwahl)
-        - Added ability to delete schemes (#20 - thanks spektom)
-        - Added the --file option (#21)
-        - Scheme.activate returns a Connection object (#22)
-        - Added the autoconnect command (#23)
-        - Fixed parsing error missing channel (#24 - thanks LiorKirsch)
-        - Fixed relative signal return as zero (#25 - thanks LiorKirsch)
-        - Relative signals are now converted to dBm (#26 - thanks LiorKirsch)
-        - Various codebase cleanup (#27 - thanks ramnes)
-        - Added support for WPA Version 1 (#28 - thanks LiorKirsch)
-        - Fixed Python3 support for WPA/PBKDF2
-        
-        0.2.2
-        ^^^^^
-        :release-date: 2013-12-25
-        
-        - Fixed relative signal parsing bug (#12 - thanks alexykot)
-        
-        0.2.1
-        ^^^^^
-        :release-date: 2013-11-22
-        
-        - Fixed print_table str/int bug (#13 - thanks DanLipsitt)
-        
-        0.2.0
-        ^^^^^
-        :release-date: 2013-09-27
-        
-        - Added support for WEP
-        - Fixed bug related to very short SSIDs
-        - Fixed bug related to numeric passkeys
-        
-        0.1.1
-        ^^^^^
-        :release-date: 2013-05-26
-        
-        - Updated setup.py to actually install the bash completion script
-        
-Platform: Debian
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Topic :: System :: Networking
-Classifier: Operating System :: POSIX :: Linux
-Classifier: Environment :: Console
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
diff --git a/README.rst b/README.rst
index 30103ed..f10f059 100644
--- a/README.rst
+++ b/README.rst
@@ -1,3 +1,17 @@
+**Note:** This project is unmaintained. While I would love to keep up the
+development on this project, it is difficult for me for several reasons:
+
+1.  I don't have enough time.
+
+2.  I switched to Fedora and the corresponding scripts to manage WiFi are
+    completely different. I was looking into re-writing the library in order to
+    support more than just Debian based architectures, but it was too involved.
+
+If anybody wants to take over the development of WiFi, please contact me. You
+can find my email in the commit message.
+
+----
+
 wifi
 ----
 
@@ -11,7 +25,7 @@ wifi command is also implemented as a library that can be used from Python.
     # wifi --help
 
 
-.. image:: https://travis-ci.org/rockymeza/wifi.png?branch=master
-   :target: https://travis-ci.org/rockymeza/wifi
+.. image:: https://travis-ci.org/melvyn-sopacua/wifi.png?branch=master
+   :target: https://travis-ci.org/melvyn-sopacua/wifi
 
 The documentation for wifi lives at https://wifi.readthedocs.org/en/latest/.
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..9a5c9a7
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/wifi.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/wifi.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/wifi"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/wifi"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/docs/changelog.rst b/docs/changelog.rst
new file mode 100644
index 0000000..212b8f1
--- /dev/null
+++ b/docs/changelog.rst
@@ -0,0 +1,5 @@
+:tocdepth: 1
+
+.. _changes:
+
+.. include:: ../CHANGES.rst
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..ddb2f21
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,242 @@
+# -*- coding: utf-8 -*-
+#
+# wifi documentation build configuration file, created by
+# sphinx-quickstart on Mon Dec 24 14:32:32 2012.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'wifi'
+copyright = u'2012, Rocky Meza and Gavin Wahl'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.2'
+# The full version, including alpha/beta/rc tags.
+release = '0.2.0'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'wifidoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'wifi.tex', u'wifi Documentation',
+   u'Rocky Meza and Gavin Wahl', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', 'wifi', u'wifi Documentation',
+     [u'Rocky Meza and Gavin Wahl'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+  ('index', 'wifi', u'wifi Documentation',
+   u'Rocky Meza and Gavin Wahl', 'wifi', 'One line description of project.',
+   'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..054d062
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,68 @@
+wifi, a Python interface
+========================
+
+**Note:** This project is unmaintained. For more information, please visit the
+GitHub page.
+
+----
+
+Wifi provides a set of tools for configuring and connecting to WiFi networks on Linux systems.
+Using this library, you can discover networks, connect to them, save your configurations, and much, much more.
+
+The original impetus for creating this library was my frustration with with connecting to the Internet using NetworkManager and wicd.
+It is very much for computer programmers, not so much for normal computer users.
+Wifi is built on top the old technologies of the `/etc/network/interfaces` file and `ifup` and `ifdown`.
+It is inspired by `ifscheme`.
+
+The library also comes with an executable that you can use to manage your WiFi connections.
+Wifi currently supports the following encryption types:
+
+-  No encryption
+-  WEP
+-  WPA2
+
+If you need support for other network types, please file a bug on GitHub and we'll definitely try to get to it.
+Patches, of course, are always welcome.
+
+
+Installation
+------------
+
+Wifi is available for installation on PyPI::
+
+    $ pip install wifi
+
+This will install the :doc:`the wifi command <wifi_command>`, a Python library for discovering and connecting to wifi networks, and a bash completion file for the wifi command.
+
+On some systems, the wifi command name is already used, and installing wifi will cause issues with the system.
+In those cases you can override the command name that is installed::
+
+    $ WIFI_CLI_NAME=cool-wifi pip install wifi
+
+`The wifi executable <wifi_command>` will instead be named `cool-wifi`.
+
+If you only want the Python library and don't care about the CLI, you can also disable it::
+
+    $ WIFI_INSTALL_CLI=False pip install wifi
+
+There will be no extra executable installed, but the wifi CLI will still be available using this invocation style::
+
+    $ python -m wifi
+
+
+Documentation
+-------------
+
+.. toctree::
+    :maxdepth: 2
+
+    wifi_command
+    scanning
+    changelog
+
+Contributing
+------------
+
+The (very little) development for wifi happens on GitHub.
+If you ever run into issues with wifi, please don't hesitate to open an issue.
+Pull requests are welcome.
diff --git a/docs/scanning.rst b/docs/scanning.rst
new file mode 100644
index 0000000..77472ff
--- /dev/null
+++ b/docs/scanning.rst
@@ -0,0 +1,69 @@
+Managing WiFi networks
+======================
+
+.. currentmodule:: wifi
+
+Discovering networks
+--------------------
+
+You can use this library to scan for networks that are available in the air.
+To get a list of the different cells in the area, you can do ::
+
+    >>> from wifi import Cell, Scheme
+    >>> Cell.all('wlan0')
+
+This returns a list of :class:`Cell` objects.  Under the hood, this calls `iwlist scan` and parses the unfriendly output.
+
+Each cell object should have the following attributes:
+
+- :attr:`ssid`
+- :attr:`signal`
+- :attr:`quality`
+- :attr:`frequency`
+- :attr:`bitrates`
+- :attr:`encrypted`
+- :attr:`channel`
+- :attr:`address`
+- :attr:`mode`
+
+For cells that have :attr:`encrypted` as `True`, there will also be the following attribute:
+
+- :attr:`encryption_type`
+
+Additional attributes may be available, based on the type of the encryption. Support for this
+has started in release 0.4.0 and will be enhanced in to subsequent releases.
+
+.. note::
+
+    Scanning requires root permission to see all the networks.
+    If you are not root, iwlist only returns the network you are currently connected to.
+
+
+Connecting to a network
+-----------------------
+
+In order to connect to a network, you need to set up a scheme for it. ::
+
+    >>> cell = Cell.all('wlan0')[0]
+    >>> scheme = Scheme.for_cell('wlan0', 'home', cell, passkey)
+    >>> scheme.save()
+    >>> scheme.activate()
+
+Once you have a scheme saved, you can retrieve it using :meth:`Scheme.find`. ::
+
+    >>> scheme = Scheme.find('wlan0', 'home')
+    >>> scheme.activate()
+
+.. note::
+
+    Activating a scheme will disconnect from any other scheme before connecting.
+
+    You must be root to connect to a network.
+    Wifi uses `ifdown` and `ifup` to connect and disconnect.
+
+
+.. autoclass:: Cell
+    :members:
+
+.. autoclass:: Scheme
+    :members:
diff --git a/docs/wifi_command.rst b/docs/wifi_command.rst
new file mode 100644
index 0000000..8e00d8e
--- /dev/null
+++ b/docs/wifi_command.rst
@@ -0,0 +1,155 @@
+The wifi Command
+================
+
+This library comes with a command line program for managing and saving your WiFi connections.
+
+Tutorial
+^^^^^^^^
+
+This tutorial assumes you are comfortable on the command line.
+(If you aren't, perhaps wifi is not quite the right tool for you.)
+
+First, if you haven't already, install wifi.
+
+.. code-block:: sh
+
+    $ pip install wifi
+
+Now, you want to see what networks are available.
+You can run the ``scan`` command to do that.
+
+.. note::
+    All of these commands need to run as a superuser.
+
+.. code-block:: sh
+
+    # wifi scan
+    -61  SomeNet                  protected
+    -62  SomeOtherNet             unprotected
+    -78  zxy-12345                protected
+    -86  TP-LINK_CB1676           protected
+    -86  TP-LINK_PocketAP_D8B616  unprotected
+    -82  TP-LINK_C1DBE8           protected
+    -86  XXYYYYZZZ                protected
+    -87  Made Up Name             protected
+
+.. note::
+
+    The wifi command is also accessible through the python argument as::
+
+        # python -m wifi
+
+The scan command returns three bits of data: the signal quality, the SSID and if the network is protected or not.
+If you want to order the networks by quality, you can pipe the output into sort.
+
+.. code-block:: sh
+
+    # wifi scan | sort -rn
+    -61  SomeNet                  protected
+    -62  SomeOtherNet             unprotected
+    -78  zxy-12345                protected
+    -82  TP-LINK_C1DBE8           protected
+    -86  XXYYYYZZZ                protected
+    -86  TP-LINK_PocketAP_D8B616  unprotected
+    -86  TP-LINK_CB1676           protected
+    -87  Made Up Name             protected
+
+The greater the number, the better the signal.
+
+We decide to use the ``SomeNet`` network because that's the closest one (plus we know the password).
+We can connect to it directly using the ``connect`` command.
+
+.. code-block:: sh
+
+    # wifi connect --ad-hoc SomeNet
+    passkey>
+
+The ``--ad-hoc`` or ``-a`` option allows us to connect to a network that we haven't configured before.
+The wifi asks you for a passkey if the network is protected and then it will connect.
+
+If you want to actually save the configuration instead of just connecting once, you can use the ``add`` command.
+
+.. code-block:: sh
+
+    # wifi add some SomeNet
+    passkey>
+
+``some`` here is a nickname for the network you can use when you want to connect to the network again.
+Now we can connect to the saved network if you want using the ``connect`` command.
+
+.. code-block:: sh
+
+    # wifi connect some
+    ...
+
+If you wish to see all the saved networks, you can use the ``list`` command.
+
+
+.. code-block:: sh
+
+    # wifi list
+    some
+
+Usage
+^^^^^
+
+::
+
+    usage: wifi {scan,list,config,add,connect,init} ...
+
+scan
+----
+
+Shows a list of available networks. ::
+
+    usage: wifi scan
+
+list
+----
+
+Shows a list of networks already configured. ::
+
+    usage: wifi list
+
... 1771 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/wifi-python.git



More information about the Python-modules-commits mailing list