Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Return True if base_class_name contributes to the this_class class.

        def inherits_from(this_class,
                  base_class_name):
    '''Return True if base_class_name contributes to the this_class class.'''

    if this_class.__bases__:
        for b in this_class.__bases__:
            if inherits_from(b, base_class_name):
                return True

    if this_class.__name__ == base_class_name:
        return True

    return False
        


src/e/d/edna-HEAD/libraries/xia2core-r298/Python/Decorators/CCP4Decorator.py   edna(Download)
import sys
 
from DecoratorHelper import inherits_from
 
def CCP4DecoratorFactory(DriverInstance):
    # directly.
 
    if not inherits_from(DriverInstanceClass, 'DefaultDriver'):
        raise RuntimeError, 'object %s is not a Driver implementation' % \
              str(DriverInstance)