From 59ca35df4a090bfb9ba4e17504263512e3225eef Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Sat, 13 Aug 2011 18:16:47 +0200 Subject: [PATCH] Make generating python2.4 compatible, add bython binary variable --- config.mk | 7 ++++++- pylib/gfxprim/gfxprimconfig.py | 3 ++- pylib/gfxprim/pixeltype.py | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config.mk b/config.mk index eb23555c..962c414b 100644 --- a/config.mk +++ b/config.mk @@ -5,5 +5,10 @@ LDLIBS+=-ldl # path to local module directory PYLIBSDIR=$(TOPDIR)/pylib +# Python binary/version +PYTHON_BIN=python +# To test with other python versions (example): +#PYTHON_BIN=${TOPDIR}/virtualpy2.4/bin/python + # Command to run Python with pylib/ modules -PYTHON=PYTHONPATH=$$PYTHONPATH:${PYLIBSDIR} python -Werror +PYTHON=PYTHONPATH=$$PYTHONPATH:${PYLIBSDIR} ${PYTHON_BIN} -Werror diff --git a/pylib/gfxprim/gfxprimconfig.py b/pylib/gfxprim/gfxprimconfig.py index fd9088b9..33c03f90 100644 --- a/pylib/gfxprim/gfxprimconfig.py +++ b/pylib/gfxprim/gfxprimconfig.py @@ -32,7 +32,8 @@ class GfxPrimConfig(object): self.pixelsizes = pixelsizes assert isinstance(self.pixelsizes, list) assert self.pixel_size in [i.size for i in self.pixelsizes] - assert all((i.size <= self.pixel_size for i in self.pixelsizes)) + for i in self.pixelsizes: + assert i.size <= self.pixel_size # Set of all encountered channel names self.channels = set() diff --git a/pylib/gfxprim/pixeltype.py b/pylib/gfxprim/pixeltype.py index e2389a0f..fb2744fb 100644 --- a/pylib/gfxprim/pixeltype.py +++ b/pylib/gfxprim/pixeltype.py @@ -52,7 +52,9 @@ class PixelType(object): return (self.name == "UNKNOWN") def is_rgb(self): - return all((i in self.chans for i in 'RGB')) + for i in 'RGB': + if i not in self.chans: return False + return True def is_gray(self): return ('V' in self.chans) -- 2.11.4.GIT