From 09ab4249baf89dbdc51676d298b6af31a7db4fd0 Mon Sep 17 00:00:00 2001 From: RTB Date: Sun, 8 Jun 2014 19:21:56 +0200 Subject: [PATCH] added function descriptions of read_sourceonfiguration and get_section --- utils/configurator.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utils/configurator.py b/utils/configurator.py index a87b28a..83dee1b 100644 --- a/utils/configurator.py +++ b/utils/configurator.py @@ -50,12 +50,24 @@ class Configurator: @staticmethod def read_sourceconfiguration(): + """ + This function reads sources.cfg in the main folder for configuration + variables for sources + :return a ConfigParser object of sources.cfg + """ config = ConfigParser.ConfigParser() config.read('sources.cfg') # [TODO]: should be softcoded eventually return config @staticmethod def get_section(config, sourcename): + """ + This function reads a config section labeled in variable sourcename and + tests whether the reliability variable is set else set to empty string + :param config: a ConfigParser object + :param sourcename: the name of the section to be read + :return a dictionary of the section in the config labeled in sourcename + """ section = dict() if config.has_section(sourcename): section = dict(config.items(sourcename))