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
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
 
fixup(self, package, impl)
Some packages require special handling (e.g.
source code
 
installed_fixup(self, impl)
Called when an installed package is added (after fixup), or when installation completes.
source code
int
get_score(self, distro_name) source code

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

Instance Variables
str name = "fallback"
the default value for Implementation.distro_name for our implementations
[str] system_paths = ['/usr/bin', '/bin', '/usr/sbin', '/sbin']
list of paths to search for binaries (we MUST NOT find 0install launchers, so only include directories where system packages install binaries - e.g.
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_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

fixup(self, package, impl)

source code 

Some packages require special handling (e.g. Java). This is called for each package that was added by get_package_info after it returns. The default method does nothing.

Parameters:
  • package - the name of the package
  • impl - the constructed implementation

installed_fixup(self, impl)

source code 

Called when an installed package is added (after fixup), or when installation completes. This is useful to fix up the main value. The default implementation checks that main exists, and searches Distribution.system_paths for it if not.

Parameters:

Since: 1.11

get_score(self, distro_name)

source code 
Parameters:
  • distro_name (str)
Returns: int

Instance Variable Details

system_paths

list of paths to search for binaries (we MUST NOT find 0install launchers, so only include directories where system packages install binaries - e.g. /usr/bin but not /usr/local/bin)
Type:
[str]
Value:
['/usr/bin', '/bin', '/usr/sbin', '/sbin']