public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/, pmstestsuite/repository/
@ 2011-08-13  8:54 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2011-08-13  8:54 UTC (permalink / raw
  To: gentoo-commits

commit:     eb737b6165fd08cf54cdc25b16bcce5628015759
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 13 08:55:41 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug 13 08:55:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=eb737b61

Use EnvironmentError instead of (IOError, OSError).

---
 pmstestsuite/cli.py                 |    2 +-
 pmstestsuite/repository/__init__.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pmstestsuite/cli.py b/pmstestsuite/cli.py
index 8b8abe7..510d6d5 100644
--- a/pmstestsuite/cli.py
+++ b/pmstestsuite/cli.py
@@ -148,7 +148,7 @@ class PMSTestSuiteCLI(object):
 					# XXX: all PMs should match it...
 					self.repository = pm.get_repository(opts.repo_name)
 					break
-		except (OSError, IOError, KeyError, ValueError) as e:
+		except (EnvironmentError, KeyError, ValueError) as e:
 			opt.error('Repository open failed: %s' % e)
 
 		try:

diff --git a/pmstestsuite/repository/__init__.py b/pmstestsuite/repository/__init__.py
index fa059ef..e464e1a 100644
--- a/pmstestsuite/repository/__init__.py
+++ b/pmstestsuite/repository/__init__.py
@@ -19,7 +19,7 @@ class EbuildRepository(object):
 
 		@param path: path to the repository
 		@type path: string
-		@raise IOError: for repo_name file operations
+		@raise EnvironmentError: for repo_name file operations
 		@raise ValueError: if repo_name contents are invalid
 		"""
 		self.path = path
@@ -34,7 +34,7 @@ class EbuildRepository(object):
 			f = open(catspath, 'r');
 			self.categories = [l.strip() for l in f.readlines()]
 			f.close()
-		except IOError:
+		except EnvironmentError:
 			self.categories = []
 
 		if not self.repo_name:



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/, pmstestsuite/repository/
@ 2012-01-03 15:52 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2012-01-03 15:52 UTC (permalink / raw
  To: gentoo-commits

commit:     229633d614e09db16b3f3328ce25326847c9ea05
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  3 10:54:55 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jan  3 10:54:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=229633d6

Don't hardcode D-Bus paths in the eclass.

---
 pmstestsuite/dbus_handler.py          |    3 ++-
 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():
 	"""



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-03 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-13  8:54 [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/, pmstestsuite/repository/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2012-01-03 15:52 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox