YaST2 Developers Documentation: WFM built-in functions



WFM built-in functions

Args () -> list

Returns the arguments with which the module was called. It is a list whose arguments are the module's arguments. If the module was called with CallModule("my_mod", [17, true]),  Args() will return [ 17, true ].

Execute (path, any) -> any

Special interface to the system agent. Not for general use.

GetEncoding () -> string

Returns the current encoding code

GetEnvironmentEncoding () -> string

Returns the encoding code of the environment where yast is started

GetLanguage () -> string

Returns the current language code (without modifiers !)

Read (path, [any]) -> any

Special interface to the system agent. Not for general use.

SCRClose (integer handle) -> void

Close a scr instance.

SCRGetDefault () -> integer

Get's the default scr instance.

SCRGetName (integer handle) -> string

Get the name of a scr instance.

SCROpen (string name, bool check_version) -> integer

Create a new scr instance. The name must be a valid y2component name (e.g. "scr", "chroot=/mnt:scr"). The component is created immediately. The parameter check_version determined whether the SuSE Version should be checked. On error a negative value is returned.

SCRSetDefault (integer handle) -> void

Set's the default scr instance.

SetLanguage ("de_DE" [, encoding]) -> ""

Selects the language for translate() Example:

SetLanguage("de_DE", "UTF-8") -> ""
Example:
SetLanguage("de_DE@euro") -> "ISO-8859-15"
The "" is the output of 'nl_langinfo (CODESET)' and only given if SetLanguage() is called with a single argument.

Write (path, any, [any]) -> boolean

Special interface to the system agent. Not for general use.

call (string name, list arguments) -> any

Executes a YCP client or a Y2 client component. This implies that the called YCP code has full access to all module status in the currently running YaST.

The modulename is temporarily changed to the name of the called script or a component.

Example:

call ("inst_mouse", [true, false]) -> ....

In the example, WFM looks for the file YAST2HOME/clients/inst_mouse.ycp and executes it. If the client is not found, a Y2 client component is tried to be created.


YaST2 Developers Documentation: WFM built-in functions