# Path: HPCStats/Exceptions.py
# class HPCStatsDBIntegrityError(HPCStatsException):
# 
#     """Class for DB intregrity errors exceptions in HPCStats"""
# 
#     def __init__(self, msg):
# 
#         super(HPCStatsDBIntegrityError, self).__init__(msg)
# 
# class HPCStatsRuntimeError(HPCStatsException):
# 
#     """Class for runtime errors exceptions in HPCStats"""
# 
#     def __init__(self, msg):
# 
#         super(HPCStatsRuntimeError, self).__init__(msg)


import psycopg2
from HPCStats.Exceptions import HPCStatsDBIntegrityError, HPCStatsRuntimeError
        """
        self.conf = conf
        self.section = "hpcstatsdb"
        self.database = {
            'dbhostname': self.conf.get(self.section,"hostname"),
            'dbport':     self.conf.get(self.section,"port"),
            'dbname':     self.conf.get(self.section,"dbname"),
            'dbuser':     self.conf.get(self.section,"user"),
            'dbpassword': self.conf.get(self.section,"password"),
        }
        self.cur = None
        self._conn = None

    def infos(self):
        return ( self.database["dbhostname"],
                 self.database["dbport"],
                 self.database["dbname"],
                 self.database["dbuser"],
                 "XXXXXXXXXX" )

    def bind(self):
        """ Connection to the database """
        conn_str = "host = %(dbhostname)s " \
                   "dbname= %(dbname)s " \
                   "user= %(dbuser)s " \
                   "password= %(dbpassword)s" \
                     % (self.database)
        try:
            self._conn = psycopg2.connect(conn_str)
        except psycopg2.OperationalError, err:

# Path: HPCStats/Exceptions.py
# class HPCStatsDBIntegrityError(HPCStatsException):
# 
#     """Class for DB intregrity errors exceptions in HPCStats"""
# 
#     def __init__(self, msg):
# 
#         super(HPCStatsDBIntegrityError, self).__init__(msg)
# 
# class HPCStatsRuntimeError(HPCStatsException):
# 
#     """Class for runtime errors exceptions in HPCStats"""
# 
#     def __init__(self, msg):
# 
#         super(HPCStatsRuntimeError, self).__init__(msg)


# Path: HPCStats/DB/HPCStatsDB.py
import psycopg2
from HPCStats.Exceptions import HPCStatsDBIntegrityError, HPCStatsRuntimeError

        """
        self.conf = conf
        self.section = "hpcstatsdb"
        self.database = {
            'dbhostname': self.conf.get(self.section,"hostname"),
            'dbport':     self.conf.get(self.section,"port"),
            'dbname':     self.conf.get(self.section,"dbname"),
            'dbuser':     self.conf.get(self.section,"user"),
            'dbpassword': self.conf.get(self.section,"password"),
        }
        self.cur = None
        self._conn = None

    def infos(self):
        return ( self.database["dbhostname"],
                 self.database["dbport"],
                 self.database["dbname"],
                 self.database["dbuser"],
                 "XXXXXXXXXX" )

    def bind(self):
        """ Connection to the database """
        conn_str = "host = %(dbhostname)s " \
                   "dbname= %(dbname)s " \
                   "user= %(dbuser)s " \
                   "password= %(dbpassword)s" \
                     % (self.database)
        try:
            self._conn = psycopg2.connect(conn_str)
        except psycopg2.OperationalError, err:

            raise HPCStatsRuntimeError( \