From fcf0d4fa2c8e22a33821db1848bf67d1a8ebcae5 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Tue, 9 Dec 2008 14:30:43 +0000 Subject: [PATCH] gst/__init__.py: Add gst.Fourcc.__eq__ and gst.Fourcc.__ne__. Original commit message from CVS: * gst/__init__.py: Add gst.Fourcc.__eq__ and gst.Fourcc.__ne__. --- ChangeLog | 5 +++++ gst/__init__.py | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 15954ac0dd..956518a6d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-12-09 Alessandro Decina + + * gst/__init__.py: + Add gst.Fourcc.__eq__ and gst.Fourcc.__ne__. + 2008-12-09 Edward Hervey * gst/Makefile.am: diff --git a/gst/__init__.py b/gst/__init__.py index 42f164f02b..03ffc252e3 100644 --- a/gst/__init__.py +++ b/gst/__init__.py @@ -45,8 +45,18 @@ class Fourcc(Value): def __init__(self, string): Value.__init__(self, 'fourcc') self.fourcc = string + def __repr__(self): return '' % self.fourcc + + def __eq__(self, other): + if isinstance(other, Fourcc): + return self.fourcc == other.fourcc + + return False + + def __ne__(self, other): + return not self.__eq__(other) class IntRange(Value): def __init__(self, low, high):