Class: Registration::UI::WizardClient
- Inherits:
-
Object
- Object
- Registration::UI::WizardClient
- Includes:
- Yast::I18n, Yast::Logger
- Defined in:
- src/lib/registration/ui/wizard_client.rb
Overview
The base class for several clients using the Wizard module with exception handling.
Direct Known Subclasses
MigrationFinishWorkflow, MigrationReposWorkflow, RegistrationSyncWorkflow
Instance Method Summary collapse
-
#initialize ⇒ WizardClient
constructor
A new instance of WizardClient.
-
#main ⇒ Symbol
Run the main workflow, opens a Wizard dialog if not present and handles raised exceptions.
-
#run ⇒ Symbol
Run the main workflow, handles exceptions raised during the client call.
-
#run_sequence ⇒ Symbol
This is main workflow sequence, it needs to be redefined in the derived class.
Constructor Details
#initialize ⇒ WizardClient
28 29 30 |
# File 'src/lib/registration/ui/wizard_client.rb', line 28 def initialize textdomain "registration" end |
Instance Method Details
#main ⇒ Symbol
Run the main workflow, opens a Wizard dialog if not present and handles raised exceptions
35 36 37 38 39 40 41 42 43 44 45 |
# File 'src/lib/registration/ui/wizard_client.rb', line 35 def main # create the Wizard dialog if needed wizard_present = Yast::Wizard.IsWizardDialog Yast::Wizard.CreateDialog unless wizard_present begin run ensure Yast::Wizard.CloseDialog unless wizard_present end end |
#run ⇒ Symbol
Run the main workflow, handles exceptions raised during the client call.
50 51 52 53 54 55 56 57 58 59 |
# File 'src/lib/registration/ui/wizard_client.rb', line 50 def run ret = run_sequence log.info "Sequence result: #{ret}" ret rescue => e log.error "Caught error: #{e.class}: #{e.message.inspect}, #{e.backtrace}" # TRANSLATORS: error message, %s are details Yast::Report.Error(_("Internal error: %s") % e.) return :abort end |
#run_sequence ⇒ Symbol
This is main workflow sequence, it needs to be redefined in the derived class.
63 64 65 |
# File 'src/lib/registration/ui/wizard_client.rb', line 63 def run_sequence raise NotImplementedError, "method run_sequence() must be defined in the derived class" end |