(self, target)
Looks up the plugin for a given target and returns an instance of the 
        delegate class or None if no plugin is registered for the given target.
        Matches are done from left to right, ie. ('Fedora', '16', 'x86_64') will
        match a plugin with a target of ('Fedora', None, None) but not
        ('Fedora', None, 'x86_64')
        
        @param target A list or string matching the target field of the
        plugin's .info file.
    
        @return An instance of the delegate class of the plugin or None.
Looks up the plugin for a given target and returns an instance of the 
        delegate class or None if no plugin is registered for the given target.
        Matches are done from left to right, ie. ('Fedora', '16', 'x86_64') will
        match a plugin with a target of ('Fedora', None, None) but not
        ('Fedora', None, 'x86_64')
Looks up the plugin for a given target and returns an instance of the delegate class or None if no plugin is registered for the given target . Matches are done from left to right ie . ( Fedora 16 x86_64 ) will match a plugin with a target of ( Fedora None None ) but not ( Fedora None x86_64 )
def plugin_for_target(self, target):
        """
        Looks up the plugin for a given target and returns an instance of the 
        delegate class or None if no plugin is registered for the given target.
        Matches are done from left to right, ie. ('Fedora', '16', 'x86_64') will
        match a plugin with a target of ('Fedora', None, None) but not
        ('Fedora', None, 'x86_64')
        
        @param target A list or string matching the target field of the
        plugin's .info file.
    
        @return An instance of the delegate class of the plugin or None.
        """
        try:
            if isinstance(target, str):
                self.log.debug("Attempting to match string target (%s)" % target)
                plugin_name = self._targets.get(tuple([target]))
                if not plugin_name:
                    raise ImageFactoryException("No plugin .info file loaded for target: %s" % (target))
                plugin = __import__('%s.%s' % (PKG_STR, plugin_name), fromlist=['delegate_class'])
                return plugin.delegate_class()
            elif isinstance(target, tuple):
                _target = list(target)
                self.log.debug("Attempting to match list target (%s)" % (str(_target)))
                for index in range(1, len(target) + 1):
                    plugin_name = self._targets.get(tuple(_target))
                    if not plugin_name:
                        _target[-index] = None
                    else:
                        plugin = __import__('%s.%s' % (PKG_STR, plugin_name), fromlist=['delegate_class'])
                        return plugin.delegate_class()
        except ImportError as e:
            self.log.exception(e)
            raise ImageFactoryException("Unable to import plugin for target: %s" % str(target))
def plugin_for_target ( self , target ) : try : if isinstance ( target , str ) : self . log . debug ( "Attempting to match string target (%s)" % target ) plugin_name = self . _targets . get ( tuple ( [ target ] ) ) if not plugin_name : raise ImageFactoryException ( "No plugin .info file loaded for target: %s" % ( target ) ) plugin = __import__ ( '%s.%s' % ( PKG_STR , plugin_name ) , fromlist = [ 'delegate_class' ] ) return plugin . delegate_class ( ) elif isinstance ( target , tuple ) : _target = list ( target ) self . log . debug ( "Attempting to match list target (%s)" % ( str ( _target ) ) ) for index in range ( 1 , len ( target ) + 1 ) : plugin_name = self . _targets . get ( tuple ( _target ) ) if not plugin_name : _target [ - index ] = None else : plugin = __import__ ( '%s.%s' % ( PKG_STR , plugin_name ) , fromlist = [ 'delegate_class' ] ) return plugin . delegate_class ( ) except ImportError as e : self . log . exception ( e ) raise ImageFactoryException ( "Unable to import plugin for target: %s" % str ( target ) )