From fe7e13a1233801c79bc9287fb6568fb3333649e9 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Fri, 5 Aug 2005 04:42:41 +0000 Subject: bam, herpes --- portage/util/inheritance.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 portage/util/inheritance.py diff --git a/portage/util/inheritance.py b/portage/util/inheritance.py new file mode 100644 index 0000000..0105e9b --- /dev/null +++ b/portage/util/inheritance.py @@ -0,0 +1,11 @@ +# Copyright: 2005 Gentoo Foundation +# Author(s): Brian Harring (ferringb@gentoo.org) +# License: GPL2 +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/util/inheritance.py,v 1.1 2005/08/05 04:42:41 ferringb Exp $ + +def check_for_base(obj, allowed): + """Look through __class__ to see if any of the allowed classes are found, returning the first allowed found""" + for x in allowed: + if issubclass(obj.__class__, x): + return x + return None -- cgit v1.2.3-65-gdbad