diff options
author | Auke Booij (tulcod) <auke@tulcod.com> | 2010-07-31 13:19:52 +0200 |
---|---|---|
committer | Auke Booij (tulcod) <auke@tulcod.com> | 2010-07-31 15:10:11 +0200 |
commit | e04c6de19680aacfce6f0d0d663b92e6f58ea7be (patch) | |
tree | 35936d68e2963c4627b3ba2b53036ab34cd35e51 /g_common | |
parent | Adding g-cran.cfg (diff) | |
download | g-cran-e04c6de19680aacfce6f0d0d663b92e6f58ea7be.tar.gz g-cran-e04c6de19680aacfce6f0d0d663b92e6f58ea7be.tar.bz2 g-cran-e04c6de19680aacfce6f0d0d663b92e6f58ea7be.zip |
Change config file format
Diffstat (limited to 'g_common')
-rw-r--r-- | g_common/g_common.py | 11 |
1 files 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]+" <local repository directory> <action> [<action arguments>...]" @@ -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): |