[tracker/tracker-0.8] data-generators: Check if the cfg file has been actually loaded
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] data-generators: Check if the cfg file has been actually loaded
- Date: Thu, 13 May 2010 14:13:27 +0000 (UTC)
commit d673ee174fa4523330310c570d1f9366fcff2514
Author: Ivan Frade <ivan frade nokia com>
Date: Fri May 7 14:02:35 2010 +0300
data-generators: Check if the cfg file has been actually loaded
utils/data-generators/cc/generate | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/utils/data-generators/cc/generate b/utils/data-generators/cc/generate
index 92ab7a4..f323e68 100755
--- a/utils/data-generators/cc/generate
+++ b/utils/data-generators/cc/generate
@@ -29,9 +29,14 @@ if len(sys.argv) != 2:
config = ConfigParser.RawConfigParser()
try:
- config.read(sys.argv[1])
+ loaded_files = config.read(sys.argv[1])
except:
- print "Failed to read configuration file %s", sys.argv[1]
+ print "Failed to read configuration file %s" % (sys.argv[1])
+ sys.exit (-1)
+
+if (len(loaded_files) != 1):
+ print "Cannot open %s" % (sys.argv[1])
+ sys.exit (-1)
# set up all known types
tools.addType( 'nco#EmailAddress', 10 )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]