Package zeroinstall :: Package injector :: Module distro :: Class Distribution
[frames] | no frames]

Class Distribution

source code

object --+
         |
        Distribution

Represents a distribution with which we can integrate. Sub-classes should specialise this to integrate with the package managers of particular distributions. This base class ignores the native package manager.


Since: 0.28

Instance Methods
 
get_package_info(self, package, factory)
Get information about the given package.
source code
int | None
get_score(self, distribution)
Indicate how closely the host distribution matches this one.
source code
model.ZeroInstallFeed
get_feed(self, master_feed)
Generate a feed containing information about distribution packages.
source code
 
fetch_candidates(self, master_feed)
Collect information about versions we could install using the distribution's package manager.
source code
packagekit.PackageKit
packagekit(self)
For use by subclasses.
source code

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

Properties

Inherited from object: __class__

Method Details

get_package_info(self, package, factory)

source code 

Get information about the given package. Add zero or more implementations using the factory (typically at most two will be added; the currently installed version and the latest available).

Parameters:
  • package (str) - package name (e.g. "gimp")
  • factory (str -> model.DistributionImplementation) - function for creating new DistributionImplementation objects from IDs

get_score(self, distribution)

source code 

Indicate how closely the host distribution matches this one. The <package-implementation> with the highest score is passed to Distribution.get_package_info. If several elements get the same score, get_package_info is called for all of them.

Parameters:
  • distribution (str) - a distribution name
Returns: int | None
an integer, or None if there is no match at all

get_feed(self, master_feed)

source code 

Generate a feed containing information about distribution packages. This should immediately return a feed containing an implementation for the package if it's already installed. Information about versions that could be installed using the distribution's package manager can be added asynchronously later (see fetch_candidates).

Parameters:
Returns: model.ZeroInstallFeed

fetch_candidates(self, master_feed)

source code 

Collect information about versions we could install using the distribution's package manager. On success, the distribution feed in iface_cache is updated.

Returns:
a tasks.Blocker if the task is in progress, or None if not

packagekit(self)

source code 

For use by subclasses.

Returns: packagekit.PackageKit
Decorators:
  • @property