[kupfer] settings: Catch ResourceLookupError



commit c131b5612a5d15b38b8d2480acc94e996e7cd317
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Mon Sep 14 05:45:29 2009 +0200

    settings: Catch ResourceLookupError

 kupfer/settings.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/kupfer/settings.py b/kupfer/settings.py
index 86f0928..556cedd 100644
--- a/kupfer/settings.py
+++ b/kupfer/settings.py
@@ -65,11 +65,9 @@ class SettingsController (gobject.GObject, pretty.OutputMixin):
 
 		# Read all config files
 		config_files = []
-		defaults_path = config.get_data_file(self.defaults_filename)
-		if not defaults_path:
-			# try local file
-			defaults_path = os.path.join("data", self.defaults_filename)
-		if not os.path.exists(defaults_path):
+		try:
+			defaults_path = config.get_data_file(self.defaults_filename)
+		except config.ResourceLookupError, exc:
 			print "Error: no default config file %s found!" % self.defaults_filename
 		else:
 			config_files += (defaults_path, )



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]