YaST2 Developers Documentation: PackageSlideShow.ycp Purpose: Module to access slides from installation repository

PackageSlideShow.ycp Purpose: Module to access slides from installation repository

  • Stefan Hundhammer
  • Stanislav Visnovsky

This module has an unstable interface.

Imports

  • Installation
  • Mode
  • SlideShow
  • Slides
  • String
  • URL

Global Functions

Local Functions

global StripReleaseNo (string pkg_name) -> string

Get version info for a package (without build no.)

Parameters:
pkg_name name of the package without path and ".rpm" extension
Return value:
version string
global StripPath (string pkg_name) -> string

Get package file name from path

Parameters:
pkg_name location of the package
Return value:
package file name
global SetMediaType (string new_media_type) -> void

set media type "CD" or "DVD"

Parameters:
new_media_type
local ListSum (list<integer> sizes) -> integer

Sum up all list items

Parameters:
sizes
local ListSumCutOff (list<integer> sizes, integer max_cutoff) -> integer

Sum up all positive list items, but cut off individual items at a maximum value. Negative return values indicate overflow of any individual item at "max_cutoff". In this case, the absolute value of the return value is "max_cutoff" * number of overflows. (e.g. >2hour + >2hours + 1:13:20 => >4hours

Parameters:
sizes
max_cutoff
local FormatTimeShowOverflow (integer seconds) -> string

Format an integer seconds value with min:sec or hours:min:sec

Parameters:
seconds
local FormatRemainingSize (integer remaining) -> string

Format number of remaining bytes to be installed as string.

Parameters:
remaining bytes remaining, -1 for 'done'
Return value:
human readable remaining time or byte / kB/ MB size
local FormatRemainingCount (integer remaining) -> string

Format number of remaining packages to be installed as string.

Parameters:
remaining bytes remaining, -1 for 'done'
Return value:
human readable remaining time or byte / kB/ MB size
local SanityCheck (boolean silent) -> boolean

Perform sanity check for correct initialzation etc.

Parameters:
silent don't complain in log file
Return value:
true if OK, false if any error
local SubtractPackageSize (integer pkg_size) -> void

Update internal bookkeeping: subtract size of one package from the global list of remaining sizes per CD

Parameters:
pkg_size
global InitPkgData (boolean force) -> void

Initialize internal pacakge data, such as remaining package sizes and times. This may not be called before the pkginfo server is up and running, so this cannot be reliably done from the constructor in all cases.

Parameters:
force true to force reinitialization
local FindNextMedia () -> void

Try to figure out what media will be needed next and set next_src_no and next_cd_no accordingly.

global SetCurrentCdNo (integer src_no, integer cd_no) -> void

Set the current repository and CD number. Must be called for each CD change. src_no: 1...n cd_no: 1...n

Parameters:
src_no
cd_no
local RecalcRemainingTimes (boolean force_recalc) -> boolean

Recalculate remaining times per CD based on package sizes remaining and data rate so far. Recalculation is only done each 'recalc_interval' seconds unless 'force_recalc' is set to 'true'.

Parameters:
force_recalc force recalculation even if timeout not reached yet
Return value:
true if recalculated, false if not
local SwitchToSecondsIfNecessary () -> boolean

Switch unit to seconds if necessary and recalc everything accordingly.

Return value:
true if just switched from sizes to seconds, false otherwise
global UpdateCurrentCdProgress (boolean silent_check) -> void

Update progress widgets for the current CD: Label and ProgressBar. Use global statistics variables for that.

Parameters:
silent_check
local UpdateTotalProgress (boolean silent_check) -> void

Update progress widgets

Parameters:
silent_check
local CdStatisticsTableItems () -> list<term>

Returns a table widget item list for CD statistics

global UpdateCurrentPackageProgress (integer pkg_percent) -> void

Progress display update This is called via the packager's progress callbacks.

Parameters:
pkg_percent package percentage
global UpdateAllCdProgress (boolean silent_check) -> void

Update progress widgets for all CDs. Uses global statistics variables.

Parameters:
silent_check
local CdProgressId (integer src_no, integer cd_no) -> string

Return a CD's progress bar ID

Parameters:
src_no number of the repository (from 0 on)
cd_no number of the CD within that repository (from 0 on)
global SlideDisplayDone (string pkg_name, integer pkg_size, boolean deleting) -> void

package start display update - this is called at the end of a new package

Parameters:
pkg_name package name
pkg_size
deleting Flag: deleting (true) or installing (false) package?
global SlideDisplayStart (string pkg_name, string pkg_location, string pkg_summary, integer pkg_size, boolean deleting) -> void

package start display update - this is called at the beginning of a new package

Parameters:
pkg_name package name
pkg_location
pkg_summary package summary (short description)
pkg_size
deleting Flag: deleting (true) or installing (false) package?
global SlideProvideStart (string pkg_name, integer sz, boolean remote) -> void

Package providal start

Parameters:
pkg_name
sz
remote