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

def zeroinstall::injector::iface_cache::IfaceCache::update_interface_if_trusted (   self,
  interface,
  sigs,
  xml 
)

Update a cached interface (using L{update_interface_from_network})
if we trust the signatures, and remove it from L{pending}.
If we don't trust any of the signatures, do nothing.
@param interface: the interface being updated
@type interface: L{model.Interface}
@param sigs: signatures from L{gpg.check_stream}
@type sigs: [L{gpg.Signature}]
@param xml: the downloaded replacement interface document
@type xml: str
@return: True if the interface was updated
@rtype: bool
@precondition: call L{add_pending}

Definition at line 197 of file iface_cache.py.

00197                                                                  :
            """Update a cached interface (using L{update_interface_from_network})
            if we trust the signatures, and remove it from L{pending}.
            If we don't trust any of the signatures, do nothing.
            @param interface: the interface being updated
            @type interface: L{model.Interface}
            @param sigs: signatures from L{gpg.check_stream}
            @type sigs: [L{gpg.Signature}]
            @param xml: the downloaded replacement interface document
            @type xml: str
            @return: True if the interface was updated
            @rtype: bool
            @precondition: call L{add_pending}
            """
            updated = self._oldest_trusted(sigs)
            if updated is None: return False    # None are trusted
      
            if interface.uri in self.pending:
                  del self.pending[interface.uri]
            else:
                  raise Exception("update_interface_if_trusted, but '%s' not pending!" % interface.uri)

            self.update_interface_from_network(interface, xml, updated)
            return True

      def download_key(self, interface, key_id):


Generated by  Doxygen 1.6.0   Back to index