-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YCP Killer: Translate YCP files into Ruby
The commit is a result of running YCP Killer's "ruby" command. See also: https://github.com/yast/ycp-killer
- Loading branch information
Showing
22 changed files
with
5,684 additions
and
4,988 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# encoding: utf-8 | ||
|
||
# File: | ||
# kdump_auto.ycp | ||
# | ||
# Module: | ||
# Kdump installation and configuration | ||
# | ||
# Summary: | ||
# Kdump autoinstallation preparation | ||
# | ||
# Authors: | ||
# Jozef Uhliarik <juhliarik@suse.cz> | ||
# | ||
# | ||
module Yast | ||
class KdumpAutoClient < Client | ||
def main | ||
Yast.import "UI" | ||
textdomain "kdump" | ||
|
||
Builtins.y2milestone("----------------------------------------") | ||
Builtins.y2milestone("kdump auto started") | ||
|
||
Yast.import "Kdump" | ||
Yast.import "Mode" | ||
Yast.import "Progress" | ||
|
||
Yast.include self, "kdump/wizards.rb" | ||
|
||
@progress_orig = Progress.set(false) | ||
|
||
|
||
@ret = nil | ||
@func = "" | ||
@param = {} | ||
|
||
# Check arguments | ||
if Ops.greater_than(Builtins.size(WFM.Args), 0) && | ||
Ops.is_string?(WFM.Args(0)) | ||
@func = Convert.to_string(WFM.Args(0)) | ||
if Ops.greater_than(Builtins.size(WFM.Args), 1) && | ||
Ops.is_map?(WFM.Args(1)) | ||
@param = Convert.to_map(WFM.Args(1)) | ||
end | ||
end | ||
Builtins.y2debug("func=%1", @func) | ||
Builtins.y2debug("param=%1", @param) | ||
|
||
if @func == "Import" | ||
@ret = Kdump.Import(@param) | ||
# Create a summary | ||
# return string | ||
elsif @func == "Summary" | ||
@ret = Ops.add( | ||
Ops.add( | ||
"<UL>", | ||
Builtins.mergestring(Builtins.maplist(Kdump.Summary) do |l| | ||
Ops.add("<LI>", l) | ||
end, "\n") | ||
), | ||
"</UL>" | ||
) | ||
# did configuration changed | ||
# return boolean | ||
elsif @func == "GetModified" | ||
@ret = Kdump.GetModified | ||
# set configuration as changed | ||
# return boolean | ||
elsif @func == "SetModified" | ||
Kdump.SetModified | ||
@ret = true | ||
# Reset configuration | ||
# return map or list | ||
elsif @func == "Reset" | ||
Kdump.Import({}) | ||
@ret = {} | ||
# Change configuration | ||
# return symbol (i.e. `finish || `accept || `next || `cancel || `abort) | ||
elsif @func == "Change" | ||
@ret = KdumpAutoSequence() | ||
return deep_copy(@ret) | ||
# Return configuration data | ||
# return map or list | ||
elsif @func == "Export" | ||
@ret = Kdump.Export | ||
# Write configuration data | ||
# return boolean | ||
elsif @func == "Write" | ||
@ret = Kdump.Write | ||
elsif @func == "Read" | ||
@ret = Kdump.Read | ||
else | ||
Builtins.y2error("unknown function: %1", @func) | ||
@ret = false | ||
end | ||
Progress.set(@progress_orig) | ||
|
||
Builtins.y2debug("ret=%1", @ret) | ||
Builtins.y2milestone("kdump_auto finished") | ||
Builtins.y2milestone("----------------------------------------") | ||
|
||
deep_copy(@ret) | ||
|
||
# EOF | ||
end | ||
end | ||
end | ||
|
||
Yast::KdumpAutoClient.new.main |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# encoding: utf-8 | ||
|
||
# File: | ||
# kdump_finish.ycp | ||
# | ||
# Module: | ||
# Step of base installation finish | ||
# | ||
# Authors: | ||
# Jozef Uhliarik <juhliarik@suse.cz> | ||
# | ||
# | ||
module Yast | ||
class KdumpFinishClient < Client | ||
def main | ||
|
||
textdomain "kdump" | ||
|
||
Yast.import "Kdump" | ||
Yast.import "Mode" | ||
Yast.import "Progress" | ||
|
||
@ret = nil | ||
@func = "" | ||
@param = {} | ||
|
||
# Check arguments | ||
if Ops.greater_than(Builtins.size(WFM.Args), 0) && | ||
Ops.is_string?(WFM.Args(0)) | ||
@func = Convert.to_string(WFM.Args(0)) | ||
if Ops.greater_than(Builtins.size(WFM.Args), 1) && | ||
Ops.is_map?(WFM.Args(1)) | ||
@param = Convert.to_map(WFM.Args(1)) | ||
end | ||
end | ||
|
||
@progress_orig = Progress.set(false) | ||
|
||
Builtins.y2milestone("starting kdump_finish") | ||
Builtins.y2debug("func=%1", @func) | ||
Builtins.y2debug("param=%1", @param) | ||
|
||
if @func == "Info" | ||
return { | ||
"steps" => 3, | ||
# progress step title | ||
"title" => _("Saving kdump configuration..."), | ||
"when" => [:installation, :update, :autoinst] | ||
} | ||
elsif @func == "Write" | ||
# propose settings for kdump if autoyast doesn't include settings for yast2-kdump | ||
Kdump.Propose if !Kdump.import_called && Mode.autoinst | ||
if Mode.update | ||
Kdump.Update | ||
else | ||
Kdump.Write | ||
end | ||
else | ||
Builtins.y2error("unknown function: %1", @func) | ||
@ret = nil | ||
end | ||
Progress.set(@progress_orig) | ||
Builtins.y2debug("ret=%1", @ret) | ||
Builtins.y2milestone("kdump_finish finished") | ||
deep_copy(@ret) | ||
end | ||
end | ||
end | ||
|
||
Yast::KdumpFinishClient.new.main |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.