# Path: HPCStats/Exceptions.py
# class HPCStatsConfigurationException(HPCStatsException):
# 
#     """Class for configuration file exceptions in HPCStats"""
# 
#     def __init__(self, msg):
# 
#         super(HPCStatsConfigurationException, self).__init__(msg)


import ConfigParser
import os
import sys
from HPCStats.Exceptions import HPCStatsConfigurationException
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with HPCStats. If not, see
# <http://www.gnu.org/licenses/>.
#
# On Calibre systems, the complete text of the GNU General
# Public License can be found in `/usr/share/common-licenses/GPL'.



class HPCStatsConf(ConfigParser.ConfigParser, object):

    def __init__(self, filename, cluster):

        super(HPCStatsConf, self).__init__()

        self.cluster = cluster
        self.filename = filename

    def read(self):
        """Check if configuration file exists and then read it. Raises
           HPCStatsConfigurationException if configuration file does not exist.
        """

        if not os.path.exists(self.filename):

# Path: HPCStats/Exceptions.py
# class HPCStatsConfigurationException(HPCStatsException):
# 
#     """Class for configuration file exceptions in HPCStats"""
# 
#     def __init__(self, msg):
# 
#         super(HPCStatsConfigurationException, self).__init__(msg)


# Path: HPCStats/Conf/HPCStatsConf.py
import ConfigParser
import os
import sys
from HPCStats.Exceptions import HPCStatsConfigurationException

#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with HPCStats. If not, see
# <http://www.gnu.org/licenses/>.
#
# On Calibre systems, the complete text of the GNU General
# Public License can be found in `/usr/share/common-licenses/GPL'.



class HPCStatsConf(ConfigParser.ConfigParser, object):

    def __init__(self, filename, cluster):

        super(HPCStatsConf, self).__init__()

        self.cluster = cluster
        self.filename = filename

    def read(self):
        """Check if configuration file exists and then read it. Raises
           HPCStatsConfigurationException if configuration file does not exist.
        """

        if not os.path.exists(self.filename):

            raise HPCStatsConfigurationException(