Unknown YCP Module |
routines.ycp
Author: Ladislav Slezak |
|
|
|
Functions used in hwinfo and in init_hwinfo modules.
Imports
Includes
Local Variables
Local Functions
|
|
|
local resolution (any a, map m) -> string
|
|
reads values from map and creates formatted label for monitor resolution data
- Parameters:
a |
dummy parameter? |
m |
device info |
- Return value:
local translate_hw_entry (map<string,any> hw) -> map<string,any>
|
|
tries to determine hardware name by class_id and sub_class_id
and substitues them in given map. returns modified map
- Parameters:
- Return value:
|
device info with translated class information |
local classtostring (any a, map<string,any> m) -> string
|
|
Translate subclass identification of the device
- Parameters:
a |
dummy parameter? |
m |
device information |
- Return value:
local representant_order -> list<string>
|
|
order table: list of lists.
first item of nested list is key name
second is term that should be used for formating the key- takes key name as first argument
if third item is true, the whole map will be passed to term as second argument
local trans_str (string str) -> string
|
|
translate string - looks to the translation table and returns value
- Parameters:
- Return value:
|
translated string or original string if translation is unknown |
local trans_bool (any b) -> string
|
|
translate boolean to Yes/No
- Parameters:
- Return value:
|
parameter b converted to string, if b is boolean then Yes/No is returned |
local scalar (any node) -> boolean
|
|
evals to true if given value is scalar (not map or term or list)
- Parameters:
- Return value:
|
true if parameter node is a scalar value (it isn't a list or a map) |
local get_representant (map<string,any> m) -> string
|
|
if expandTree function tries to explore list, it should use some
label for each item. it tree items are maps, this function decides
which value from map will be used as label
- Parameters:
- Return value:
|
name of the selected representant for whole map |
local expandTree (any node) -> list
|
|
Recursively converts (scalar/nested) lists and maps to tree datastructure
- Parameters:
- Return value:
|
list of items (content of tree widget) |
local save_hwinfo (string file) -> boolean
|
|
Save hwinfo output to the specified file
- Parameters:
- Return value:
|
True if saving was successful |
local save_hwinfo_to_file (string target_file_name) -> boolean
|
|
Save hwinfo output to the specified file, progress popup is displayed.
Display error message when saving failed.
- Parameters:
target_file_name |
Target file |
- Return value:
|
True if saving was successful |
local mount_device (string device) -> string
|
|
Mount specified device
- Parameters:
device |
device name to mount |
- Return value:
|
mount point where device was mounted (in /tmp subdirectory)
or nil when mount failed |
local umount_device (string mount_point) -> boolean
|
|
Unmount device
- Parameters:
mount_point |
directory where device is mounted |
- Return value:
|