From 9866127e6a381bce8cd6c0d3f93a4c061b762e01 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 10 Dec 2014 15:31:22 +0000 Subject: [PATCH] small cleanups --- TODO | 2 ++ python/Makefile.am | 14 +++++++++++++- python/README.md | 15 +++++++++++++++ python/README.txt | 13 ------------- python/Vips.py | 7 ++++++- 5 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 python/README.md delete mode 100644 python/README.txt diff --git a/TODO b/TODO index 6f65a300..6934827a 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +- try new binding with python3 + - use vips_resize() in vipsthumbnail? should the sharpening filter be selectable? diff --git a/python/Makefile.am b/python/Makefile.am index b1693cf8..ef08f882 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -4,4 +4,16 @@ pygioverrides_PYTHON = \ Vips.py EXTRA_DIST = \ - README.txt + README.md + +# if we build in a separate tree, we need to symlink the *.py files from the +# source tree; Python does not accept the extensions and modules in different +# paths +build_pylinks: + for f in $(pygioverrides_PYTHON); do \ + [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \ + done + +all-local: build_pylinks +check-local: build_pylinks + diff --git a/python/README.md b/python/README.md new file mode 100644 index 00000000..b61ba7d3 --- /dev/null +++ b/python/README.md @@ -0,0 +1,15 @@ +# vips8 binding for Python + +This overrides file adds a few small helper functions to the +gobject-introspection binding for libvips. + +There's a chapter in the libvips API docs on these overrides, see "Using +libvips from Python". + +vips-x.y.z/test has a test suite. + +Vips.py needs to be in the overrides directory of your gobject-introspection +pygobject area, for example: + + sudo cp Vips.py /usr/lib/python2.7/dist-packages/gi/overrides + diff --git a/python/README.txt b/python/README.txt deleted file mode 100644 index 712e322a..00000000 --- a/python/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -vips8 binding for Python - -This binding adds a few small helper functions to the gobject-introspection -binding for libvips. - -The test/ directory has a test suite. - -Vips.py needs to be in the overrides directory of your gobject-introspection -pygobject area, for example: - -sudo cp Vips.py /usr/lib/python2.7/dist-packages/gi/overrides - - diff --git a/python/Vips.py b/python/Vips.py index da0d6bb8..872859ab 100644 --- a/python/Vips.py +++ b/python/Vips.py @@ -1,7 +1,12 @@ # -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab -# copy this file to /usr/lib/python2.7/dist-packages/gi/overrides/ +# copy this file to /usr/lib/python2.7/dist-packages/gi/overrides, eg. +# +# sudo cp Vips.py /usr/lib/python2.7/dist-packages/gi/overrides +# +# Alternatively, build vips to another prefix, then copy Vips.py and Vips.pyc +# from $prefix/lib/python2.7/dist-packages/gi/overrides to /usr # This file is part of VIPS. #