[tracker] data-generators: Check if the cfg file has been actually loaded
- From: Ivan Frade <ifrade src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] data-generators: Check if the cfg file has been actually loaded
- Date: Fri, 7 May 2010 11:04:42 +0000 (UTC)
commit c0ac68cd380c77c3cf1ae3c005e9ff30f57180bb
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 99e3ce0..8776d06 100755
--- a/utils/data-generators/cc/generate
+++ b/utils/data-generators/cc/generate
@@ -30,9 +30,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]