diff options
author | Michał Górny <mgorny@gentoo.org> | 2012-01-03 11:54:55 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2012-01-03 11:54:55 +0100 |
commit | 229633d614e09db16b3f3328ce25326847c9ea05 (patch) | |
tree | e0d1a093ad9b0b443f8b66a2d96b2a6051e52bdb /pmstestsuite | |
parent | Instantiate the D-Bus handler in CLI. (diff) | |
download | pms-test-suite-229633d614e09db16b3f3328ce25326847c9ea05.tar.gz pms-test-suite-229633d614e09db16b3f3328ce25326847c9ea05.tar.bz2 pms-test-suite-229633d614e09db16b3f3328ce25326847c9ea05.zip |
Don't hardcode D-Bus paths in the eclass.
Diffstat (limited to 'pmstestsuite')
-rw-r--r-- | pmstestsuite/dbus_handler.py | 3 | ||||
-rw-r--r-- | pmstestsuite/repository/pms_eclass.py | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/pmstestsuite/dbus_handler.py b/pmstestsuite/dbus_handler.py index e508d18..6f50140 100644 --- a/pmstestsuite/dbus_handler.py +++ b/pmstestsuite/dbus_handler.py @@ -6,6 +6,7 @@ import dbus from dbus.mainloop.glib import DBusGMainLoop dbus_interface_name = 'org.gentoo.pmstestsuite' +dbus_bus_name = dbus_interface_name dbus_object_prefix = '/org/gentoo/pmstestsuite' class DBusHandler(object): @@ -15,4 +16,4 @@ class DBusHandler(object): """ Initialize DBusHandler. Add it to main GLib loop. """ DBusGMainLoop(set_as_default=True) self.bus = dbus.SystemBus() - self.busname = dbus.service.BusName(dbus_interface_name, self.bus) + self.busname = dbus.service.BusName(dbus_bus_name, self.bus) diff --git a/pmstestsuite/repository/pms_eclass.py b/pmstestsuite/repository/pms_eclass.py index 9be1ee0..336a22a 100644 --- a/pmstestsuite/repository/pms_eclass.py +++ b/pmstestsuite/repository/pms_eclass.py @@ -4,6 +4,9 @@ import os.path +from ..dbus_handler import dbus_bus_name, dbus_object_prefix, \ + dbus_interface_name + eclass_contents = """# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ @@ -31,9 +34,9 @@ pms-test_dbus_call() { --system \\ --print-reply \\ --type=method_call \\ - --dest=org.gentoo.pmstestsuite \\ - /org/gentoo/pmstestsuite/${PMS_TEST_DBUS_P} \\ - org.gentoo.pmstestsuite.${method} \\ + --dest=%s \\ + %s/${PMS_TEST_DBUS_P} \\ + %s.${method} \\ "${@}" } @@ -46,7 +49,7 @@ pms-test_dbus_append_result() { pms-test_pkg_setup() { pms-test_dbus_call test_started } -""" +""" % (dbus_bus_name, dbus_object_prefix, dbus_interface_name) def get_common_eclass_files(): """ |