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

def zeroinstall::injector::policy::Policy::get_unusable_reason (   self,
  impl,
  restrictions = [] 
)

@param impl: Implementation to test.
@type restrictions: [L{model.Restriction}]
@return: The reason why this impl is unusable, or None if it's OK.
@rtype: str
@note: The restrictions are for the interface being requested, not the interface
of the implementation; they may be different when feeds are being used.

Definition at line 365 of file policy.py.

00365                                                             :
            """
            @param impl: Implementation to test.
            @type restrictions: [L{model.Restriction}]
            @return: The reason why this impl is unusable, or None if it's OK.
            @rtype: str
            @note: The restrictions are for the interface being requested, not the interface
            of the implementation; they may be different when feeds are being used."""
            for r in restrictions:
                  if not r.meets_restriction(impl):
                        return "Incompatible with another selected implementation"
            stability = impl.get_stability()
            if stability <= buggy:
                  return stability.name
            if self.network_use == network_offline and not self.get_cached(impl):
                  return "Not cached and we are off-line"
            if impl.os not in arch.os_ranks:
                  return "Unsupported OS"
            # When looking for source code, we need to known if we're
            # looking at an implementation of the root interface, even if
            # it's from a feed, hence the sneaky restrictions identity check.
            if self.src and restrictions is self.root_restrictions:
                  if impl.machine != 'src':
                        return "Not source code"
            else:
                  if impl.machine not in arch.machine_ranks:
                        if impl.machine == 'src':
                              return "Source code"
                        return "Unsupported machine type"
            return None
      
      def get_interface(self, uri):


Generated by  Doxygen 1.6.0   Back to index