From e04c6de19680aacfce6f0d0d663b92e6f58ea7be Mon Sep 17 00:00:00 2001 From: "Auke Booij (tulcod)" Date: Sat, 31 Jul 2010 13:19:52 +0200 Subject: Change config file format --- g_common/g_common.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/g_common/g_common.py b/g_common/g_common.py index 02542a6..73f3e86 100644 --- a/g_common/g_common.py +++ b/g_common/g_common.py @@ -1,5 +1,5 @@ #!/usr/bin/python -import getopt, sys, os, string, urllib, re, ConfigParser, subprocess +import getopt, sys, os, string, urllib, re, subprocess import settings #__doc__="Usage: "+sys.argv[0]+" [...]" @@ -14,9 +14,12 @@ def list_configured_drivers(): #read key=value file to dict def read_config(conf_file,defaults={}): - conf=ConfigParser.ConfigParser(defaults) - conf.read(conf_file) - return conf.items('DEFAULTS') + conffile=open(conf_file) + conf=defaults.copy() + for line in conffile: + if len(line): + conf[line[:line.find("=")]]=line[line.find("=")+1:] + return conf #returns dict of key=value config file def read_driver_config(driver_name): -- cgit v1.2.3-65-gdbad