Module: Yast::SCR

Defined in:
src/ruby/yast/scr.rb

Overview

Wrapper class for SCR component in Yast See yast documentation for SCR

Class Method Summary collapse

Class Method Details

.Dir(path) ⇒ Array<String>

Gets array of all children attached directly below path

Examples:

get all sysconfig agents

SCR.Dir(path(".sysconfig"))

get all keys in install inf

SCR.Dir(path(".etc.install_inf"))


54
55
56
# File 'src/ruby/yast/scr.rb', line 54

def self.Dir(path)
  call_builtin_wrapper("Dir", Yast.path(path))
end

.Error(path) ⇒ Hash

Gets detailled error description from agent



61
62
63
# File 'src/ruby/yast/scr.rb', line 61

def self.Error(path)
  call_builtin_wrapper("Error", Yast.path(path))
end

.Execute(path, *args) ⇒ Object

Executes command

Examples:

halt computer

SCR.Execute(path(".target.bash"), "/sbin/halt -f -n -p")

umount /mnt path

SCR.Execute(path(".target.umount"), "/mnt")


42
43
44
# File 'src/ruby/yast/scr.rb', line 42

def self.Execute(path, *args)
  call_builtin_wrapper("Execute", Yast.path(path), *args)
end

.Read(path, *args) ⇒ Object

Reads data

Examples:

Get netcards discovered by probe agent

SCR.Read(path(".probe.netcard"))

Read content of file /tmp/test

SCR.Read(path(".target.string"), "tmp/test")


17
18
19
# File 'src/ruby/yast/scr.rb', line 17

def self.Read(path, *args)
  call_builtin_wrapper("Read", Yast.path(path), *args)
end

.RegisterAgent(path, description) ⇒ true, false

Register an agent at given path with description



71
72
73
# File 'src/ruby/yast/scr.rb', line 71

def self.RegisterAgent(path, description)
  call_builtin_wrapper("RegisterAgent", Yast.path(path), description)
end

.RegisterNewAgentstrue, false

Register new agents. (bnc#245508#c16)

Rescan the scrconf registration directories and register any agents at new(!) paths. Agents, even new ones, on paths that are registered already, will not be replaced. This means that .oes.specific.agent will start to work but something like adding /usr/local/etc/sysconfig to .sysconfig.network would not.



83
84
85
# File 'src/ruby/yast/scr.rb', line 83

def self.RegisterNewAgents
  call_builtin_wrapper("RegisterNewAgents")
end

.UnmountAgent(path) ⇒ Object

Unmounts agent. The agent is detached, but when needed it is mounted again automatically.

It sends to component result() which force to terminate component. If there is any lazy write, then it is properly finished.



105
106
107
# File 'src/ruby/yast/scr.rb', line 105

def self.UnmountAgent(path)
  call_builtin_wrapper("UnmountAgent", Yast.path(path))
end

.UnregisterAgent(path) ⇒ true, false

Unregister agent from given path



90
91
92
# File 'src/ruby/yast/scr.rb', line 90

def self.UnregisterAgent(path)
  call_builtin_wrapper("UnregisterAgent", Yast.path(path))
end

.UnregisterAllAgentstrue, false

Unregister all agents



96
97
98
# File 'src/ruby/yast/scr.rb', line 96

def self.UnregisterAllAgents
  call_builtin_wrapper("UnregisterAllAgents")
end

.Write(path, *args) ⇒ true, false

Writes data

Examples:

change default desktop in sysconfig to kde

SCR.Write(path(".sysconfig.windowmanager.DEFAULT_WM"), "kde")

write string s to file /tmp/f

SCR.Write(path(".target.string"), "/tmp/f", "s")


31
32
33
# File 'src/ruby/yast/scr.rb', line 31

def self.Write(path, *args)
  call_builtin_wrapper("Write", Yast.path(path), *args)
end