svn commit: r267230 - in user/jceel/soc2014_evdev/contrib/python-evdev: . bin doc doc/_static doc/_templates evdev tests

Jakub Wojciech Klama jceel at FreeBSD.org
Sun Jun 8 11:27:24 UTC 2014


Author: jceel
Date: Sun Jun  8 11:27:21 2014
New Revision: 267230
URL: http://svnweb.freebsd.org/changeset/base/267230

Log:
  Import python-evdev @91a04332.

Added:
  user/jceel/soc2014_evdev/contrib/python-evdev/
  user/jceel/soc2014_evdev/contrib/python-evdev/.gitignore
  user/jceel/soc2014_evdev/contrib/python-evdev/LICENSE
  user/jceel/soc2014_evdev/contrib/python-evdev/MANIFEST.in   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/README.rst
  user/jceel/soc2014_evdev/contrib/python-evdev/bin/
  user/jceel/soc2014_evdev/contrib/python-evdev/bin/evtest.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/bin/udev-example.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/Makefile   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/_static/
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/_static/.keep
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/_templates/
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/_templates/.keep
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/apidoc.rst
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/changelog.rst
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/conf.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/index.rst
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/install.rst
  user/jceel/soc2014_evdev/contrib/python-evdev/doc/tutorial.rst
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/__init__.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/device.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/ecodes.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/ecodes.sh   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/events.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/ff.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/genecodes.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/input.c   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/uinput.c   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/uinput.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/evdev/util.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/setup.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/tests/
  user/jceel/soc2014_evdev/contrib/python-evdev/tests/test_ecodes.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/tests/test_events.py   (contents, props changed)
  user/jceel/soc2014_evdev/contrib/python-evdev/tests/test_uinput.py   (contents, props changed)

Added: user/jceel/soc2014_evdev/contrib/python-evdev/.gitignore
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/.gitignore	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,21 @@
+# --- Python ---
+*.py[co]
+*.egg
+*.egg-info/
+develop-eggs/
+dist/
+build/
+dropin.cache
+pip-log.txt
+.installed.cfg
+.coverage
+tags
+TAGS
+evdev/*.so
+evdev/ecodes.c
+doc/_build
+__pycache__
+
+evdev/_ecodes.py
+evdev/_input.py
+evdev/_uinput.py

Added: user/jceel/soc2014_evdev/contrib/python-evdev/LICENSE
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/LICENSE	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,28 @@
+Copyright (c) 2012-2013 Georgi Valkov. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+   
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+
+  3. Neither the name of author nor the names of its contributors may
+     be used to endorse or promote products derived from this software
+     without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL GEORGI VALKOV BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Added: user/jceel/soc2014_evdev/contrib/python-evdev/MANIFEST.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/MANIFEST.in	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,4 @@
+# make github and sdist happy
+include README.rst
+include evdev/genecodes.py
+include LICENSE

Added: user/jceel/soc2014_evdev/contrib/python-evdev/README.rst
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/README.rst	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,24 @@
+*evdev*
+-------
+
+This package provides bindings to the generic input event interface in
+Linux. The *evdev* interface serves the purpose of passing events
+generated in the kernel directly to userspace through character
+devices that are typically located in ``/dev/input/``.
+
+This package also comes with bindings to *uinput*, the userspace input
+subsystem. *Uinput* allows userspace programs to create and handle
+input devices that can inject events directly into the input
+subsystem.
+
+Documentation:
+    http://python-evdev.readthedocs.org/en/latest/
+
+Development:
+    https://github.com/gvalkov/python-evdev
+
+Package:
+    http://pypi.python.org/pypi/evdev
+
+Changelog:
+    http://python-evdev.readthedocs.org/en/latest/changelog.html

Added: user/jceel/soc2014_evdev/contrib/python-evdev/bin/evtest.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/bin/evtest.py	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+# encoding: utf-8
+
+'''
+evdev example - input device event monitor
+'''
+
+
+from sys import argv, exit
+from select import select
+from evdev import ecodes, InputDevice, list_devices, AbsInfo
+
+
+usage = 'usage: evtest <device> [<type> <value>]'
+evfmt = 'time {:<16} type {} ({}), code {:<4} ({}), value {}'
+device_dir = '/dev/input/'
+query_type = None
+query_value = None
+
+
+def select_device():
+    '''Select a device from the list of accessible input devices.'''
+
+    devices = [InputDevice(i) for i in reversed(list_devices(device_dir))]
+    if not devices:
+        print('error: no input devices found (do you have rw permission on /dev/input/*?)')
+        exit(1)
+
+    dev_fmt = '{0:<3} {1.fn:<20} {1.name:<35} {1.phys}'
+    dev_lns = [dev_fmt.format(n, d) for n, d in enumerate(devices)]
+
+    print('ID  {:<20} {:<35} {}'.format('Device', 'Name', 'Phys'))
+    print('-' * len(max(dev_lns, key=len)))
+    print('\n'.join(dev_lns))
+    print('')
+
+    choice = input('Select device [0-{}]:'.format(len(dev_lns)-1))
+    return devices[int(choice)]
+
+
+def print_event(e):
+    if e.type == ecodes.EV_SYN:
+        if e.code == ecodes.SYN_MT_REPORT:
+            print('time {:<16} +++++++++ {} ++++++++'.format(e.timestamp(), ecodes.SYN[e.code]))
+        else:
+            print('time {:<16} --------- {} --------'.format(e.timestamp(), ecodes.SYN[e.code]))
+    else:
+        if e.type in ecodes.bytype:
+            codename = ecodes.bytype[e.type][e.code]
+        else:
+            codename = '?'
+
+        print(evfmt.format(e.timestamp(), e.type, ecodes.EV[e.type], e.code, codename, e.value))
+
+
+if len(argv) == 1:
+    device = select_device()
+
+elif len(argv) == 2:
+    device = InputDevice(argv[1])
+
+elif len(argv) == 4:
+    device = InputDevice(argv[1])
+    query_type = argv[2]
+    query_value = argv[3]
+else:
+    print(usage)
+    exit(1)
+
+capabs = device.capabilities(verbose=True)
+
+print('Device name: {.name}'.format(device))
+print('Device info: {.info}'.format(device))
+print('Repeat settings: {}'.format(device.repeat))
+
+if ('EV_LED', ecodes.EV_LED) in capabs:
+    print('Active LEDs: {}\n'.format(','.join(i[0] for i in device.leds(True))))
+
+print('Device capabilities:')
+for type, codes in capabs.items():
+    print('  Type {} {}:'.format(*type))
+    for i in codes:
+        # i <- ('BTN_RIGHT', 273) or (['BTN_LEFT', 'BTN_MOUSE'], 272)
+        if isinstance(i[1], AbsInfo):
+            print('    Code {:<4} {}:'.format(*i[0]))
+            print('      {}'.format(i[1]))
+        else:
+            # multiple names may resolve to one value
+            s = ', '.join(i[0]) if isinstance(i[0], list) else i[0]
+            print('    Code {:<4} {}'.format(s, i[1]))
+    print('')
+
+
+print('Listening for events ...\n')
+while True:
+    r, w, e = select([device], [], [])
+
+    for ev in device.read():
+        print_event(ev)

Added: user/jceel/soc2014_evdev/contrib/python-evdev/bin/udev-example.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/bin/udev-example.py	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,59 @@
+#!/usr/bin/env python3
+
+'''
+This is an example of using pyudev[1] alongside evdev.
+[1]: https://pyudev.readthedocs.org/
+'''
+
+import functools
+import pyudev
+
+from select import select
+from evdev import InputDevice
+
+context = pyudev.Context()
+monitor = pyudev.Monitor.from_netlink(context)
+monitor.filter_by(subsystem='input')
+monitor.start()
+
+fds = {monitor.fileno(): monitor}
+finalizers = []
+
+while True:
+    r, w, x = select(fds, [], [])
+
+    if monitor.fileno() in r:
+        r.remove(monitor.fileno())
+
+        for udev in iter(functools.partial(monitor.poll, 0), None):
+            # we're only interested in devices that have a device node
+            # (e.g. /dev/input/eventX)
+            if not udev.device_node:
+                break
+
+            # find the device we're interested in and add it to fds
+            for name in (i['NAME'] for i in udev.ancestors if 'NAME' in i):
+                # I used a virtual input device for this test - you
+                # should adapt this to your needs
+                if u'py-evdev-uinput' in name:
+                    if udev.action == u'add':
+                        print('Device added: %s' % udev)
+                        fds[dev.fd] = InputDevice(udev.device_node)
+                        break
+                    if udev.action == u'remove':
+                        print('Device removed: %s' % udev)
+
+                        def helper():
+                            global fds
+                            fds = {monitor.fileno(): monitor}
+
+                        finalizers.append(helper)
+                        break
+
+    for fd in r:
+        dev = fds[fd]
+        for event in dev.read():
+            print(event)
+
+    for i in range(len(finalizers)):
+        finalizers.pop()()

Added: user/jceel/soc2014_evdev/contrib/python-evdev/doc/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/doc/Makefile	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,159 @@
+# 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 ziphtml
+
+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/python-evdev.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python-evdev.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/python-evdev"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/python-evdev"
+	@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."
+
+$(BUILDDIR)/html/evdev-doc.zip: html
+	cd $(BUILDDIR)/html/ &&  zip -x \*.zip -r evdev-doc.zip .
+	@echo `readlink -f $@`
+
+htmlzip: $(BUILDDIR)/html/evdev-doc.zip

Added: user/jceel/soc2014_evdev/contrib/python-evdev/doc/_static/.keep
==============================================================================

Added: user/jceel/soc2014_evdev/contrib/python-evdev/doc/_templates/.keep
==============================================================================

Added: user/jceel/soc2014_evdev/contrib/python-evdev/doc/apidoc.rst
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/doc/apidoc.rst	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,40 @@
+API documentation
+-----------------
+
+``events``
+============
+
+.. automodule:: evdev.events
+   :members: InputEvent, KeyEvent, AbsEvent, RelEvent, SynEvent, event_factory
+   :undoc-members:
+   :member-order: groupwise
+
+``device``
+============
+
+.. automodule:: evdev.device
+   :members: InputDevice, DeviceInfo, AbsInfo, KbdInfo
+   :undoc-members:
+   :special-members:
+   :member-order: groupwise
+
+``uinput``
+============
+
+.. autoclass:: evdev.uinput.UInput
+   :members:
+   :special-members:
+   :member-order: groupwise
+
+``util``
+==========
+
+.. automodule:: evdev.util
+   :members: list_devices, is_device, categorize, resolve_ecodes
+   :member-order: groupwise
+
+``ecodes``
+============
+
+.. automodule:: evdev.ecodes
+   :members:

Added: user/jceel/soc2014_evdev/contrib/python-evdev/doc/changelog.rst
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/doc/changelog.rst	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,173 @@
+Changelog
+=========
+
+0.4.4 (Jun 04, 2014)
+^^^^^^^^^^^^^^^^^^^^
+
+Fixes:
+    - Calling ``InputDevice.read_one()`` should always return
+      ``None``, when there is nothing to be read, even in case of a
+      ``EAGAIN`` errno (thanks JPP).
+
+0.4.3 (Dec 19, 2013)
+^^^^^^^^^^^^^^^^^^^^
+
+Fixes:
+    - Silence ``OSError`` in destructor (thanks `@polyphemus`_).
+
+    - Make ``InputDevice.close()`` work in cases in which stdin (fd 0)
+      has been closed (thanks `@polyphemus`_).
+
+0.4.2 (Dec 13, 2013)
+^^^^^^^^^^^^^^^^^^^^
+
+Enhancements:
+    - Rework documentation and docstrings.
+
+Fixes:
+    - Call ``InputDevice.close()`` in ``InputDevice.__del__()``.
+
+0.4.1 (Jul 24, 2013)
+^^^^^^^^^^^^^^^^^^^^
+
+Fixes:
+    - Fix reference counting in ``device_read``, ``device_read_many``
+      and ``ioctl_capabilities``.
+
+0.4.0 (Jul 01, 2013)
+^^^^^^^^^^^^^^^^^^^^
+
+Enhancements:
+    - Add ``FF_*`` and ``FF_STATUS`` codes to ``ecodes`` (thanks `@bgilbert`_).
+
+    - Reverse event code mappings (``ecodes.{KEY,FF,REL,ABS}`` and
+      etc.) will now map to a list of codes, whenever a value
+      corresponds to multiple codes::
+
+        >>> ecodes.KEY[152]
+        ... ['KEY_COFFEE', 'KEY_SCREENLOCK']
+        >>> ecodes.KEY[30]
+        ... 'KEY_A'
+
+    - Set the state of a LED through ``device.set_led()`` (thanks
+      `@accek`_). ``device.fd`` is opened in ``O_RDWR`` mode from now on.
+
+Fixes:
+    - Fix segfault in ``device_read_many()`` (thanks `@bgilbert`_).
+
+0.3.3 (May 29, 2013)
+^^^^^^^^^^^^^^^^^^^^
+
+Fixes:
+    - Raise ``IOError`` from ``device_read()`` and ``device_read_many()`` when
+      ``read()`` fails.
+
+    - Several stability and style changes (thank you debian code reviewers).
+
+0.3.2 (Apr 05, 2013)
+^^^^^^^^^^^^^^^^^^^^
+
+Fixes:
+    - Fix vendor id and product id order in ``DeviceInfo`` (thanks `@kived`_).
+
+0.3.1 (Nov 23, 2012)
+^^^^^^^^^^^^^^^^^^^^
+
+Fixes:
+    - ``device.read()`` will return an empty tuple if the device has
+      nothing to offer (instead of segfaulting).
+
+    - Exclude unnecessary package data in sdist and bdist.
+
+0.3.0 (Nov 06, 2012)
+^^^^^^^^^^^^^^^^^^^^
+
+Enhancements:
+    - Add ability to set/get auto-repeat settings with ``EVIOC{SG}REP``.
+
+    - Add ``device.version`` - the value of ``EVIOCGVERSION``.
+
+    - Add ``device.read_loop()``.
+
+    - Add ``device.grab()`` and ``device.ungrab()`` - exposes ``EVIOCGRAB``.
+
+    - Add ``device.leds`` - exposes ``EVIOCGLED``.
+
+    - Replace ``DeviceInfo`` class with a namedtuple.
+
+Fixes:
+    - ``device.read_one()`` was dropping events.
+
+    - Rename ``AbsData`` to ``AbsInfo`` (as in ``struct input_absinfo``).
+
+
+0.2.0 (Aug 22, 2012)
+^^^^^^^^^^^^^^^^^^^^
+
+Enhancements:
+    - Add the ability to set arbitrary device capabilities on uinput
+      devices (defaults to all ``EV_KEY`` ecodes).
+
+    - Add ``UInput.device`` which is an open ``InputDevice`` to the
+      input device that uinput 'spawns'.
+
+    - Add ``UInput.capabilities()`` which is just a shortcut to
+      ``UInput.device.capabilities()``.
+
+    - Rename ``UInput.write()`` to ``UInput.write_event()``.
+
+    - Add a simpler ``UInput.write(type, code, value)`` method.
+
+    - Make all ``UInput`` constructor arguments optional (default
+      device name is now ``py-evdev-uinput``).
+
+    - Add the ability to set ``absmin``, ``absmax``, ``absfuzz`` and
+      ``absflat`` when specifying the uinput device's capabilities.
+
+    - Remove the ``nophys`` argument - if a device fails the
+      ``EVIOCGPHYS`` ioctl, phys will equal the empty string.
+
+    - Make ``InputDevice.capabilities()`` perform a ``EVIOCGABS`` ioctl
+      for devices that support ``EV_ABS`` and return that info wrapped in
+      an ``AbsData`` namedtuple.
+
+    - Split ``ioctl_devinfo`` into ``ioctl_devinfo`` and
+      ``ioctl_capabilities``.
+
+    - Split ``uinput_open()`` to ``uinput_open()`` and ``uinput_create()``
+
+    - Add more uinput usage examples and documentation.
+
+    - Rewrite uinput tests.
+
+    - Remove ``mouserel`` and ``mouseabs`` from ``UInput``.
+
+    - Tie the sphinx version and release to the distutils version.
+
+    - Set 'methods-before-attributes' sorting in the docs.
+
+
+Fixes:
+    - Remove ``KEY_CNT`` and ``KEY_MAX`` from ``ecodes.keys``.
+
+
+0.1.1 (May 18, 2012)
+^^^^^^^^^^^^^^^^^^^^
+
+Enhancements:
+    - Add ``events.keys``, which is a combination of all ``BTN_`` and
+      ``KEY_`` event codes.
+
+Fixes:
+    - ``ecodes.c`` was not generated when installing through ``pip``.
+
+
+0.1.0 (May 17, 2012)
+^^^^^^^^^^^^^^^^^^^^
+
+*Initial Release*
+
+.. _`@polyphemus`: https://github.com/polyphemus
+.. _`@bgilbert`: https://github.com/bgilbert
+.. _`@accek`: https://github.com/accek
+.. _`@kived`: https://github.com/kived

Added: user/jceel/soc2014_evdev/contrib/python-evdev/doc/conf.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/doc/conf.py	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,256 @@
+# -*- coding: utf-8 -*-
+
+import sys, os
+
+# Check if readthedocs is building us
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+# 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('..'))
+from setup import kw
+
+# Trick autodoc into running without having built the extension modules.
+if on_rtd:
+    with open('../evdev/_ecodes.py', 'w') as fh:
+        fh.write('''
+KEY = ABS = REL = SW = MSC = LED = REP = SND = SYN = FF = FF_STATUS = BTN_A = KEY_A = 1
+EV_KEY = EV_ABS = EV_REL = EV_SW = EV_MSC = EV_LED = EV_REP = 1
+EV_SND = EV_SYN = EV_FF  = EV_FF_STATUS = FF_STATUS = 1
+KEY_MAX, KEY_CNT = 1, 2''')
+
+    with open('../evdev/_input.py', 'w'): pass
+    with open('../evdev/_uinput.py', 'w'): pass
+
+
+# -- 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.viewcode', 'sphinx.ext.intersphinx']
+
+# 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'python-evdev'
+copyright = u'2012-2013, Georgi Valkov'
+
+# 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 full version, including alpha/beta/rc tags.
+release = kw['version']
+
+# The short X.Y version.
+version = release
+
+# 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.
+
+if not on_rtd:
+    import sphinx_rtd_theme
+    html_theme = 'sphinx_rtd_theme'
+    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+else:
+    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.
+
+# 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 = 'python-evdev-doc'
+
+
+# -- 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', 'python-evdev.tex', u'evdev documentation',
+   u'Georgi Valkov', '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', 'python-evdev', u'python-evdev Documentation',
+     [u'Georgi Valkov'], 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', 'python-evdev', u'python-evdev Documentation',
+   u'Georgi Valkov', 'evdev', 'Bindings for the linux input handling subsystem.',
+   'Miscellaneous'),
+]
+
+intersphinx_mapping = {'python': ('http://docs.python.org/3.3', None)}
+
+# 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'

Added: user/jceel/soc2014_evdev/contrib/python-evdev/doc/index.rst
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/doc/index.rst	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,71 @@
+*evdev* documentation
+---------------------
+
+This package provides bindings to the generic input event interface in
+Linux. The *evdev* interface serves the purpose of passing events
+generated in the kernel directly to userspace through character
+devices that are typically located in ``/dev/input/``.
+
+This package also comes with bindings to *uinput*, the userspace input
+subsystem. *Uinput* allows userspace programs to create and handle
+input devices that can inject events directly into the input
+subsystem.
+
+Please refer to the :doc:`tutorial <tutorial>` and the :doc:`apidoc
+<apidoc>` for usage information.
+
+Contents
+========
+
+.. toctree::
+   :maxdepth: 1
+
+   tutorial
+   install
+   apidoc
+   changelog
+
+
+Similar Projects
+================
+
+* `python-uinput`_
+* `ruby-evdev`_
+* `evdev`_ (ctypes)
+
+
+License
+=======
+
+Package :mod:`evdev` is released under the terms of the `Revised BSD License`_.
+
+
+Todo
+====
+
+* Use libudev to find the uinput device node as well as the other input
+  devices. Their locations are currently assumed to be ``/dev/uinput`` and
+  ``/dev/input/*``.
+
+* More tests.
+
+* Better uinput support (setting device capabilities as in `python-uinput`_)
+
+* Expose more input subsystem functionality (``EVIOCSKEYCODE``, ``EVIOCGREP`` etc)
+
+* Figure out if using ``linux/input.h`` and other kernel headers in your
+  userspace program binds it to the GPL2.
+
+
+Indices and Tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
+
+.. _`Revised BSD License`: https://raw.github.com/gvalkov/python-evdev/master/LICENSE
+.. _python-uinput:     https://github.com/tuomasjjrasanen/python-uinput
+.. _ruby-evdev:        http://technofetish.net/repos/buffaloplay/ruby_evdev/doc/
+.. _evdev:             http://svn.navi.cx/misc/trunk/python/evdev/

Added: user/jceel/soc2014_evdev/contrib/python-evdev/doc/install.rst
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jceel/soc2014_evdev/contrib/python-evdev/doc/install.rst	Sun Jun  8 11:27:21 2014	(r267230)
@@ -0,0 +1,42 @@
+Installation
+============
+
+Before installing :mod:`evdev`, make sure that the Python and Linux
+kernel headers are installed on your system.
+
+On a Debian compatible OS:
+
+.. code-block:: bash
+
+    $ apt-get install python-dev
+    $ apt-get install linux-headers-$(uname -r)
+
+On a Redhat compatible OS:
+
+.. code-block:: bash
+
+    $ yum install python-devel
+    $ yum install kernel-headers-$(uname -r)
+
+The latest stable version can be installed from pypi_, while the
+development version can be installed from github_:
+
+.. code-block:: bash
+
+    $ pip install evdev  # latest stable version
+    $ pip install git+git://github.com/gvalkov/python-evdev.git # latest development version
+
+:mod:`evdev` can also be installed like any other :mod:`setuptools`
+package.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-user mailing list