Exemplo n.º 1
0
    def __init__(self):
        """Initialise SQLitePwmanDatabase instance."""
        Database.__init__(self)

        try:
            self._filename = config.get_value('Database', 'filename')
        except KeyError, e:
            raise DatabaseException("SQLite: missing parameter [%s]" % (e))
Exemplo n.º 2
0
    def __init__(self):
        """Initialise SQLitePwmanDatabase instance."""
        Database.__init__(self)

        try:
            self._filename = config.get_value('Database', 'filename')
        except KeyError, e:
            raise DatabaseException(
                "SQLite: missing parameter [%s]" % (e))
Exemplo n.º 3
0
    def __init__(self, fname):
        """Initialise SQLitePwmanDatabase instance."""
        Database.__init__(self)

        try:
            self._filename = fname
        except KeyError as e:
            raise DatabaseException(
                "SQLite: missing parameter [%s]" % (e))
Exemplo n.º 4
0
    def __init__(self):
        """Initialise PostgresqlDatabase instance."""
        Database.__init__(self)

        self._tagidcache = {}
        
        config.add_defaults({"Database" : {"server": "localhost",
                                           "port"  : "5432",
                                           "database" : "pwman",
                                           "table_prefix" : "pwman_"}})
        try:
            self._server = config.get_value('Database', 'server')
            self._port = config.get_value('Database', 'port')
            self._user = config.get_value('Database', 'user')
            self._password = config.get_value('Database', 'password')
            self._database = config.get_value('Database', 'database')
            self._prefix = config.get_value('Database', 'table_prefix')
        except KeyError, e:
            raise DatabaseException(
                "Postgresql: missing parameter [%s]" % (e))
Exemplo n.º 5
0
    def __init__(self):
        """Initialise MySQLDatabase instance."""
        Database.__init__(self)

        self._tagidcache = {}
        
        config.add_defaults({"Database" : {"server": "localhost",
                                           "port"  : "3306",
                                           "database" : "pwman",
                                           "table_prefix" : "pwman_"}})
        try:
            self._server = config.get_value('Database', 'server')
            self._port = config.get_value('Database', 'port')
            self._user = config.get_value('Database', 'user')
            self._password = config.get_value('Database', 'password')
            self._database = config.get_value('Database', 'database')
            self._prefix = config.get_value('Database', 'table_prefix')
        except KeyError, e:
            raise DatabaseException(
                "MySQL: missing parameter [%s]" % (e))