Package entropy :: Package client :: Package interfaces :: Package package :: Package actions :: Module _triggers :: Class Trigger

Class Trigger

source code


Entropy Client Package installation phases trigger functions. The place where Source Package Manager (SPM) is called in order to work out installation, removal phases (setup, pre-install, post-install, post-remove, etc).

Instance Methods
 
__init__(self, entropy_client, action, phase, package_metadata, action_metadata)
Trigger manager interface constructor.
source code
int
prepare(self)
This method must be called right after the constructor in order to prepare data strctures used in the run() phase.
source code
 
run(self)
Run the actual triggers, this method must be called after prepare().
source code
 
kill(self)
Kill all the data structures created on prepare().
source code

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

Class Variables
  VALID_PHASES = ('setup', 'preinstall', 'postinstall', 'preremo...
  INSTALL_INFO_EXEC = '/usr/bin/install-info'
Properties

Inherited from object: __class__

Method Details

__init__(self, entropy_client, action, phase, package_metadata, action_metadata)
(Constructor)

source code 

Trigger manager interface constructor.

Parameters:
  • entropy_client (entropy.client.interfaces.client.Client) - Entropy Client interface object
  • action (string) - package handling action, can be "install", "remove", etc. see entropy.client.interfaces.package.Package
  • phase (string) - the package phase that is required to be run, can be either on of the Trigger.VALID_PHASES values.
  • package_metadata (dict) - package metadata that can be used by this Trigger interface
  • action_metadata (dict or None) - trigger metadata bound to action (and not to phase)
Overrides: object.__init__

prepare(self)

source code 

This method must be called right after the constructor in order to prepare data strctures used in the run() phase.

Returns: int
number of triggers that will be executed once run() is called

run(self)

source code 

Run the actual triggers, this method must be called after prepare(). This method returns an error code, non-zero values must be considered an error and further phase execution must be stopped.

kill(self)

source code 

Kill all the data structures created on prepare(). This method must be called after run().


Class Variable Details

VALID_PHASES

Value:
('setup', 'preinstall', 'postinstall', 'preremove', 'postremove')