[PATCH evemu 08/12] python: move the generated event_names.py to the python bits

Peter Hutterer peter.hutterer at who-t.net
Tue Jul 22 16:42:46 PDT 2014


The conversion script now requires manually setting PYTHONPATH unless the
evemu python bits are installed systemwide, but it's not used that often
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 .gitignore                      | 2 +-
 configure.ac                    | 1 +
 python/Makefile.am              | 2 ++
 python/evemu/Makefile.am        | 5 +++++
 src/Makefile.am                 | 5 -----
 src/convert-old-dumps-to-1.1.py | 3 ++-
 6 files changed, 11 insertions(+), 7 deletions(-)
 create mode 100644 python/evemu/Makefile.am

diff --git a/.gitignore b/.gitignore
index bb308a7..eddbe2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -87,7 +87,7 @@ patches
 .bzr
 .bzrignore
 python/evemu-test-runner
-event_names.py
+python/evemu/event_names.py
 *.pyc
 test-suite.log
 *.trs
diff --git a/configure.ac b/configure.ac
index 239811c..e222d8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,7 @@ AC_SUBST(AM_CFLAGS,
 AC_CONFIG_FILES([Makefile
                  src/Makefile
                  python/Makefile
+                 python/evemu/Makefile
                  tools/Makefile
                  test/Makefile
                  evemu.pc])
diff --git a/python/Makefile.am b/python/Makefile.am
index 3ce3946..20e50f0 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -16,6 +16,8 @@
 # You should have received a copy of the GNU General Public License along 
 # with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+SUBDIRS = evemu
+
 nobase_python_PYTHON = \
 	$(wildcard evemu/*.py)
 
diff --git a/python/evemu/Makefile.am b/python/evemu/Makefile.am
new file mode 100644
index 0000000..7048627
--- /dev/null
+++ b/python/evemu/Makefile.am
@@ -0,0 +1,5 @@
+event_names.py: Makefile $(top_srcdir)/src/make-event-names.py
+	$(PYTHON) $(top_srcdir)/src/make-event-names.py --output=python > $@
+
+BUILT_SOURCES = event_names.py
+CLEANFILES = event_names.py event_names.pyc
diff --git a/src/Makefile.am b/src/Makefile.am
index 9d30e30..8eeaf2c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,9 +20,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/include/ $(LIBEVDEV_CFLAGS)
 libevemuincludedir = $(includedir)
 libevemuinclude_HEADERS = evemu.h
 
-event_names.py: Makefile make-event-names.py
-	$(PYTHON) $(srcdir)/make-event-names.py --output=python > $@
-
 EXTRA_DIST = $(version_script) make-event-names.py convert-old-dumps-to-1.1.py
-CLEANFILES = event_names.py event_names.pyc
-BUILT_SOURCES = event_names.py
diff --git a/src/convert-old-dumps-to-1.1.py b/src/convert-old-dumps-to-1.1.py
index abac5e5..52ea141 100755
--- a/src/convert-old-dumps-to-1.1.py
+++ b/src/convert-old-dumps-to-1.1.py
@@ -3,6 +3,7 @@
 #
 # Parses evemu files with format 1.0 and outputs evemu format 1.1.
 # Command line:
+#   export PYTHONPATH=/path/to/evemu/python
 #   python convert-old-dumps-to-1.1.py myEvent.desc [myEvent.events]
 #
 
@@ -14,7 +15,7 @@ import re
 import sys
 
 import evemu
-import event_names
+import evemu.event_names
 
 def convert_events(lines):
 	event_re = re.compile(r"E: (\d+\.\d*) ([a-fA-f0-9]+) ([a-fA-f0-9]+) (-?\d*)\n")
-- 
1.9.3



More information about the Input-tools mailing list