Logo Search packages:      
Sourcecode: zeroinstall-injector version File versions

def zeroinstall::injector::policy::Policy::get_implementation (   self,
  interface 
)

Get the chosen implementation.
@type interface: Interface
@rtype: L{model.Implementation}
@raise SafeException: if interface has not been fetched or no implementation could be
chosen.

Definition at line 538 of file policy.py.

00538                                              :
            """Get the chosen implementation.
            @type interface: Interface
            @rtype: L{model.Implementation}
            @raise SafeException: if interface has not been fetched or no implementation could be
            chosen."""
            assert isinstance(interface, Interface)

            if not interface.name and not interface.feeds:
                  raise SafeException("We don't have enough information to "
                                  "run this program yet. "
                                  "Need to download:\n%s" % interface.uri)
            try:
                  return self.implementation[interface]
            except KeyError, ex:
                  if interface.implementations:
                        offline = ""
                        if self.network_use == network_offline:
                              offline = "\nThis may be because 'Network Use' is set to Off-line."
                        raise SafeException("No usable implementation found for '%s'.%s" %
                                    (interface.name, offline))
                  raise ex

      def walk_interfaces(self):


Generated by  Doxygen 1.6.0   Back to index