Package zeroinstall :: Package injector :: Module fetch :: Class Fetcher
[frames] | no frames]

Class Fetcher

source code

object --+
         |
        Fetcher

Downloads and stores various things.

Instance Methods
 
__init__(self, config)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
handler(self) source code
 
scheduler(self) source code
 
cook(self, required_digest, recipe, stores, force=False, impl_hint=None, dry_run=False, may_use_mirror=True)
Follow a Recipe.
source code
str
get_feed_mirror(self, url)
Return the URL of a mirror for this feed.
source code
 
get_packagekit_feed(self, feed_url)
Send a query to PackageKit (if available) for information about this package.
source code
zeroinstall.support.tasks.Blocker
download_and_import_feed(self, feed_url, iface_cache=None)
Download the feed, download any required keys, confirm trust if needed and import.
source code
KeyInfoFetcher
fetch_key_info(self, fingerprint) source code
tasks.Blocker
download_impl(self, impl, retrieval_method, stores, force=False)
Download an implementation.
source code
(Blocker, file)
download_archive(self, download_source, force=False, impl_hint=None, may_use_mirror=False)
Fetch an archive.
source code
tuple
download_file(self, download_source, impl_hint=None)
Fetch a single file.
source code
tasks.Task
download_icon(self, interface, force=False)
Download an icon for this interface and add it to the icon cache.
source code
zeroinstall.support.tasks.Blocker
download_impls(self, implementations, stores)
Download the given implementations, choosing a suitable retrieval method for each.
source code
model.RetrievalMethod
get_best_source(self, impl)
Return the best download source for this implementation.
source code
download.Download
download_url(self, url, hint=None, modification_time=None, expected_size=None, mirror_url=None)
The most low-level method here; just download a raw URL.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables
config.Config config
used to get handler, iface_cache and stores
{str: KeyInfoFetcher} key_info
caches information about GPG keys
Properties

Inherited from object: __class__

Method Details

__init__(self, config)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
Overrides: object.__init__

handler(self)

source code 
Decorators:
  • @property

scheduler(self)

source code 
Decorators:
  • @property

cook(self, required_digest, recipe, stores, force=False, impl_hint=None, dry_run=False, may_use_mirror=True)

source code 

Follow a Recipe.

Parameters:
  • impl_hint - the Implementation this is for (if any) as a hint for the GUI
  • force (bool)
  • dry_run (bool)
  • required_digest (str)
  • recipe (Recipe)
  • stores (zeroinstall.zerostore.Stores)
  • may_use_mirror (bool)
Decorators:
  • @tasks.async

See Also: download_impl uses this method when appropriate

get_feed_mirror(self, url)

source code 

Return the URL of a mirror for this feed.

Parameters:
  • url (str)
Returns: str

get_packagekit_feed(self, feed_url)

source code 

Send a query to PackageKit (if available) for information about this package. On success, the result is added to iface_cache.

Parameters:
  • feed_url (str)
Decorators:
  • @tasks.async

download_and_import_feed(self, feed_url, iface_cache=None)

source code 

Download the feed, download any required keys, confirm trust if needed and import.

Parameters:
Returns: zeroinstall.support.tasks.Blocker

fetch_key_info(self, fingerprint)

source code 
Parameters:
  • fingerprint (str)
Returns: KeyInfoFetcher

download_impl(self, impl, retrieval_method, stores, force=False)

source code 

Download an implementation.

Parameters:
Returns: tasks.Blocker

download_archive(self, download_source, force=False, impl_hint=None, may_use_mirror=False)

source code 

Fetch an archive. You should normally call download_impl instead, since it handles other kinds of retrieval method too. It is the caller's responsibility to ensure that the returned stream is closed.

Parameters:
Returns: (Blocker, file)

download_file(self, download_source, impl_hint=None)

source code 

Fetch a single file. You should normally call download_impl instead, since it handles other kinds of retrieval method too. It is the caller's responsibility to ensure that the returned stream is closed.

Parameters:
Returns: tuple

download_icon(self, interface, force=False)

source code 

Download an icon for this interface and add it to the icon cache. If the interface has no icon do nothing.

Parameters:
Returns: tasks.Task
the task doing the import, or None

download_impls(self, implementations, stores)

source code 

Download the given implementations, choosing a suitable retrieval method for each. If any of the retrieval methods are DistributionSources and need confirmation, handler.confirm is called to check that the installation should proceed.

Parameters:
Returns: zeroinstall.support.tasks.Blocker

get_best_source(self, impl)

source code 

Return the best download source for this implementation.

Parameters:
Returns: model.RetrievalMethod

download_url(self, url, hint=None, modification_time=None, expected_size=None, mirror_url=None)

source code 

The most low-level method here; just download a raw URL. It is the caller's responsibility to ensure that dl.stream is closed.

Parameters:
  • url (str) - the location to download from
  • hint - user-defined data to store on the Download (e.g. used by the GUI)
  • modification_time - don't download unless newer than this
  • mirror_url (str) - an altertive URL to try if this one fails
Returns: download.Download

Since: 1.5