def _load_dist_subclass(cls, *args, **kwargs):
 subclass = None
 distro = kwargs['module'].params['distro']
 if (distro is not None):
  for sc in cls.__subclasses__():
   if ((sc.distro is not None) and (sc.distro == distro)):
    subclass = sc
 if (subclass is None):
  subclass = cls
 return super(cls, subclass).__new__(subclass)

def _load_dist_subclass ( cls , * args , ** kwargs ) : subclass = None distro = kwargs [ 'module' ] . params [ 'distro' ] if ( distro is not None ) : for sc in cls . __subclasses__ ( ) : if ( ( sc . distro is not None ) and ( sc . distro == distro ) ) : subclass = sc if ( subclass is None ) : subclass = cls return super ( cls , subclass ) . __new__ ( subclass )
used for derivative implementations .