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

def zeroinstall::injector::policy::Policy::begin_impl_download (   self,
  impl,
  retrieval_method,
  force = False 
)

Start fetching impl, using retrieval_method. Each download started
will call monitor_download.

Definition at line 456 of file policy.py.

00456                                                                           :
            """Start fetching impl, using retrieval_method. Each download started
            will call monitor_download."""
            assert impl
            assert retrieval_method

            from zeroinstall.zerostore import manifest
            alg = impl.id.split('=', 1)[0]
            if alg not in manifest.algorithms:
                  raise SafeException("Unknown digest algorithm '%s' for '%s' version %s" %
                              (alg, impl.interface.get_name(), impl.get_version()))

            if isinstance(retrieval_method, DownloadSource):
                  def archive_ready(stream):
                        iface_cache.add_to_cache(retrieval_method, stream)
                  self.begin_archive_download(retrieval_method, success_callback = archive_ready, force = force)
            elif isinstance(retrieval_method, Recipe):
                  _Cook(self, impl.id, retrieval_method)
            else:
                  raise Exception("Unknown download type for '%s'" % retrieval_method)

      def begin_archive_download(self, download_source, success_callback, force = False):


Generated by  Doxygen 1.6.0   Back to index