1 |
commit: 229633d614e09db16b3f3328ce25326847c9ea05 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 3 10:54:55 2012 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 3 10:54:55 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=229633d6 |
7 |
|
8 |
Don't hardcode D-Bus paths in the eclass. |
9 |
|
10 |
--- |
11 |
pmstestsuite/dbus_handler.py | 3 ++- |
12 |
pmstestsuite/repository/pms_eclass.py | 11 +++++++---- |
13 |
2 files changed, 9 insertions(+), 5 deletions(-) |
14 |
|
15 |
diff --git a/pmstestsuite/dbus_handler.py b/pmstestsuite/dbus_handler.py |
16 |
index e508d18..6f50140 100644 |
17 |
--- a/pmstestsuite/dbus_handler.py |
18 |
+++ b/pmstestsuite/dbus_handler.py |
19 |
@@ -6,6 +6,7 @@ import dbus |
20 |
from dbus.mainloop.glib import DBusGMainLoop |
21 |
|
22 |
dbus_interface_name = 'org.gentoo.pmstestsuite' |
23 |
+dbus_bus_name = dbus_interface_name |
24 |
dbus_object_prefix = '/org/gentoo/pmstestsuite' |
25 |
|
26 |
class DBusHandler(object): |
27 |
@@ -15,4 +16,4 @@ class DBusHandler(object): |
28 |
""" Initialize DBusHandler. Add it to main GLib loop. """ |
29 |
DBusGMainLoop(set_as_default=True) |
30 |
self.bus = dbus.SystemBus() |
31 |
- self.busname = dbus.service.BusName(dbus_interface_name, self.bus) |
32 |
+ self.busname = dbus.service.BusName(dbus_bus_name, self.bus) |
33 |
|
34 |
diff --git a/pmstestsuite/repository/pms_eclass.py b/pmstestsuite/repository/pms_eclass.py |
35 |
index 9be1ee0..336a22a 100644 |
36 |
--- a/pmstestsuite/repository/pms_eclass.py |
37 |
+++ b/pmstestsuite/repository/pms_eclass.py |
38 |
@@ -4,6 +4,9 @@ |
39 |
|
40 |
import os.path |
41 |
|
42 |
+from ..dbus_handler import dbus_bus_name, dbus_object_prefix, \ |
43 |
+ dbus_interface_name |
44 |
+ |
45 |
eclass_contents = """# Copyright 1999-2012 Gentoo Foundation |
46 |
# Distributed under the terms of the GNU General Public License v2 |
47 |
# $Header: $ |
48 |
@@ -31,9 +34,9 @@ pms-test_dbus_call() { |
49 |
--system \\ |
50 |
--print-reply \\ |
51 |
--type=method_call \\ |
52 |
- --dest=org.gentoo.pmstestsuite \\ |
53 |
- /org/gentoo/pmstestsuite/${PMS_TEST_DBUS_P} \\ |
54 |
- org.gentoo.pmstestsuite.${method} \\ |
55 |
+ --dest=%s \\ |
56 |
+ %s/${PMS_TEST_DBUS_P} \\ |
57 |
+ %s.${method} \\ |
58 |
"${@}" |
59 |
} |
60 |
|
61 |
@@ -46,7 +49,7 @@ pms-test_dbus_append_result() { |
62 |
pms-test_pkg_setup() { |
63 |
pms-test_dbus_call test_started |
64 |
} |
65 |
-""" |
66 |
+""" % (dbus_bus_name, dbus_object_prefix, dbus_interface_name) |
67 |
|
68 |
def get_common_eclass_files(): |
69 |
""" |