Package zeroinstall :: Package injector :: Module solver :: Class SATSolver
[frames] | no frames]

Class SATSolver

source code

object --+    
         |    
    Solver --+
             |
            SATSolver

Converts the problem to a set of pseudo-boolean constraints and uses a PB solver to solve them.

Instance Methods
 
iface_cache(self) source code
 
__init__(self, config, extra_restrictions=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
set_langs(self, langs)
Set the preferred languages.
source code
[object]
get_rating(self, interface, impl, arch) source code
 
solve(self, root_interface, root_arch, command_name='run', closest_match=False)
Get the best implementation of root_interface and all of its dependencies.
source code
zeroinstall.SafeException
get_failure_reason(self)
Return an exception explaining why the solve failed.
source code
str
justify_decision(self, requirements, iface, impl)
Run a solve with impl_id forced to be selected, and explain why it wasn't (or was) selected in the normal case.
source code

Inherited from Solver: get_arch_for, solve_for

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

Instance Variables
str langs = property(lambda self: self._langs, set_langs)
the preferred languages (e.g.

Inherited from Solver: details, feeds_used, record_details, requires, selections

Properties

Inherited from object: __class__

Method Details

iface_cache(self)

source code 
Decorators:
  • @property

__init__(self, config, extra_restrictions=None)
(Constructor)

source code 

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

Parameters:
Overrides: object.__init__

set_langs(self, langs)

source code 

Set the preferred languages.

Parameters:
  • langs ([str]) - languages (and regions), first choice first

get_rating(self, interface, impl, arch)

source code 
Parameters:
Returns: [object]

solve(self, root_interface, root_arch, command_name='run', closest_match=False)

source code 

Get the best implementation of root_interface and all of its dependencies.

Parameters:
  • root_interface (str) - the URI of the program to be solved
  • root_arch (zeroinstall.injector.arch.Architecture) - the desired target architecture
  • command_name (str | None) - which <command> element to select
  • closest_match (bool)
Overrides: Solver.solve

justify_decision(self, requirements, iface, impl)

source code 

Run a solve with impl_id forced to be selected, and explain why it wasn't (or was) selected in the normal case.

Parameters:
Returns: str

Instance Variable Details

langs

the preferred languages (e.g. ["es_ES", "en"]). Initialised to the current locale.
Type:
str
Value:
property(lambda self: self._langs, set_langs)