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
int
compare(self, interface, b, a, arch)
Compare a and b to see which would be chosen first.
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
 
get_failure_reason(self)
Return an exception explaining why the solve failed.
source code

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

compare(self, interface, b, a, arch)

source code 

Compare a and b to see which would be chosen first. Does not consider whether the implementations are usable (check for that yourself first).

Parameters:
  • interface - The interface we are trying to resolve, which may not be the interface of a or b if they are from feeds.
Returns: int

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 - the URI of the program to be solved
  • root_arch - the desired target architecture
  • command_name - which <command> element to select
Overrides: Solver.solve
(inherited documentation)

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)