Skip to content

Commit

Permalink
WIP: fixes on the previous split
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Feb 18, 2022
1 parent 364ec4e commit af52769
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 29 deletions.
4 changes: 3 additions & 1 deletion yastd/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ PATH
eventmachine (~> 1.2.7)
fast_gettext (~> 2.2.0)
nokogiri (~> 1.13.1)
ruby-dbus (~> 0.16.0)
rexml (~> 3.2.5)
ruby-dbus (~> 0.17.0)

GEM
remote: https://rubygems.org/
Expand All @@ -32,6 +33,7 @@ GEM
rake
racc (1.6.0)
rake (13.0.6)
rexml (3.2.5)
ruby-augeas (0.5.0)
ruby-dbus (0.17.0)
rexml
Expand Down
13 changes: 5 additions & 8 deletions yastd/lib/yast2/dbus/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ module DBus
#
# @see https://rubygems.org/gems/ruby-dbus
class Installer < ::DBus::Object
PATH = "/org/opensuse/YaST/Installer1".freeze
private_constant :PATH

YAST_INSTALLER_INTERFACE = "org.opensuse.YaST.Installer1"
private_constant :YAST_INSTALLER_INTERFACE
attr_reader :installer, :logger

# @param installer [Yast2::Installer] YaST installer instance
Expand All @@ -51,14 +56,6 @@ def initialize(installer, logger)
0
end
end

private

PATH = "/org/opensuse/YaST/Installer1".freeze
private_constant :PATH

YAST_INSTALLER_INTERFACE = "org.opensuse.YaST.Installer1"
private_constant :YAST_INSTALLER_INTERFACE
end
end
end
12 changes: 6 additions & 6 deletions yastd/lib/yast2/dbus/language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ module DBus
#
# @see https://rubygems.org/gems/ruby-dbus
class Language < ::DBus::Object
PATH = "/org/opensuse/Yast/Language1".freeze
private_constant :PATH

YAST_LANGUAGE_INTERFACE = "org.opensuse.YaST.Language1".freeze
private_constant :YAST_LANGUAGE_INTERFACE

# @param installer [Yast2::Installer] YaST installer instance
def initialize(installer, logger)
@installer = installer
Expand All @@ -50,12 +56,6 @@ def initialize(installer, logger)

private

PATH = "/org/opensuse/Yast/Language1".freeze
private_constant :PATH

YAST_LANGUAGE_INTERFACE = "org.opensuse.YaST.Language1".freeze
private_constant :LANGUAGE_INTERFACE

attr_reader :installer, :logger

def available_languages
Expand Down
12 changes: 5 additions & 7 deletions yastd/lib/yast2/dbus/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ module DBus
# @see Yast2::DBus::Installer
class Service
# @return [String] service name
SERVICE_NAME = "org.opensuse.YaST"
SERVICE_NAME = "org.opensuse.YaST".freeze

# @return [String] D-Bus object path
OBJECT_PATH = "/org/opensuse/YaST/Installer1"

attr_reader :bus

def initialize(logger = nil)
Expand Down Expand Up @@ -77,19 +75,19 @@ def installer_dbus
@installer_dbus ||= Yast2::DBus::Installer.new(yast_installer, logger)
end

def language_bus
def language_dbus
@language_dbus ||= Yast2::DBus::Language.new(yast_installer, logger)
end

def software_bus
def software_dbus
@software_dbus ||= Yast2::DBus::Software.new(yast_installer, logger)
end

def installer
def yast_installer
@yast_installer ||= Yast2::Installer.new(logger: logger).tap do |installer|
# FIXME: do not probe by default
installer.probe
installer.dbus_objects = dbus_objects
#installer.dbus_objects = dbus_objects
end
end
end
Expand Down
14 changes: 7 additions & 7 deletions yastd/lib/yast2/dbus/software.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ module DBus
#
# @see https://rubygems.org/gems/ruby-dbus
class Software < ::DBus::Object
PATH = "/org/opensuse/YaST/Software1".freeze
private_constant :PATH

YAST_SOFTWARE_INTERFACE = "org.opensuse.YaST.Software1"
private_constant :YAST_SOFTWARE_INTERFACE

attr_reader :installer, :logger

# @param installer [Yast2::Installer] YaST installer instance
Expand All @@ -38,7 +44,7 @@ def initialize(installer, logger)
super(PATH)
end

dbus_interface SOFTWARE_INTERFACE do
dbus_interface YAST_SOFTWARE_INTERFACE do
dbus_reader :available_base_products, "a(ssa{sv})"
attr_writer :available_base_products
dbus_watcher :available_base_products
Expand All @@ -55,12 +61,6 @@ def initialize(installer, logger)

private

PATH = "/org/opensuse/YaST/Software1".freeze
private_constant :PATH

YAST_SOFTWARE_INTERFACE = "org.opensuse.YaST.Software1"
private_constant :YAST_SOFTWARE_INTERFACE

def available_base_products
@available_base_products ||= installer.products
end
Expand Down

0 comments on commit af52769

Please sign in to comment.