From: Diane Trout Date: Wed, 17 Jun 2009 19:25:34 +0000 (+0000) Subject: Add a hack to add a frontend section if not present X-Git-Tag: 0.2.5~5 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=e53bad95d2cf88833d2f6e90d57115f6fda2cd50 Add a hack to add a frontend section if not present This will allow the django test code to run on systems that aren't setup to run the web site. --- diff --git a/htsworkflow/frontend/settings.py b/htsworkflow/frontend/settings.py index d971bbc..42d091a 100644 --- a/htsworkflow/frontend/settings.py +++ b/htsworkflow/frontend/settings.py @@ -61,6 +61,12 @@ options = ConfigParser.SafeConfigParser( options.read([os.path.expanduser("~/.htsworkflow.ini"), '/etc/htsworkflow.ini',]) +# OptionParser will use the dictionary passed into the config parser as +# 'Default' values in any section. However it still needs an empty section +# to exist in order to retrieve anything. +if not options.has_section('frontend'): + options.add_section('frontend') + # Django settings for elandifier project. DEBUG = True