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

def zeroinstall::injector::policy::Policy::begin_iface_download (   self,
  interface,
  force = False 
)

Start downloading the interface, and add a callback to process it when
done. If it is already being downloaded, do nothing.

Definition at line 432 of file policy.py.

00432                                                               :
            """Start downloading the interface, and add a callback to process it when
            done. If it is already being downloaded, do nothing."""
            
            debug("begin_iface_download %s (force = %d)", interface, force)
            if interface.uri.startswith('/'):
                  return
            debug("Need to download")
            dl = self.handler.get_download(interface.uri, force = force)
            if dl.on_success:
                  # Possibly we should handle this better, but it's unlikely anyone will need
                  # to use an interface as an icon or implementation as well, and some of the code
                  # assumes it's OK keep asking for the same interface to be downloaded.
                  info("Already have a handler for %s; not adding another", interface)
                  return

            def feed_downloaded(stream):
                  pending = PendingFeed(interface.uri, stream)
                  iface_cache.add_pending(pending)
                  # This will trigger any required confirmations
                  self.process_pending()

            dl.on_success.append(feed_downloaded)
      
      def begin_impl_download(self, impl, retrieval_method, force = False):


Generated by  Doxygen 1.6.0   Back to index