Esempio n. 1
0
 def __init__(self, path):
     Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path)
     self.foreign_keys = True
     self.schema = self.getSchema()
     self.checkTables()
     self.site_ids = {}
     self.sites = {}
Esempio n. 2
0
 def __init__(self, path):
     Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path)
     self.foreign_keys = True
     self.schema = self.getSchema()
     self.checkTables()
     self.site_ids = {}
     self.sites = {}
Esempio n. 3
0
 def __init__(self, path):
     Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path)
     self.foreign_keys = True
     try:
         self.schema = self.getSchema()
         self.checkTables()
     except Exception, err:
         self.log.error("Error loading content.db: %s, rebuilding..." % Debug.formatException(err))
         self.close()
         os.unlink(path)  # Remove and try again
         self.schema = self.getSchema()
         self.checkTables()
Esempio n. 4
0
 def __init__(self, path):
     Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path)
     self.foreign_keys = True
     try:
         self.schema = self.getSchema()
         self.checkTables()
     except Exception, err:
         self.log.error("Error loading content.db: %s, rebuilding..." % Debug.formatException(err))
         self.close()
         os.unlink(path)  # Remove and try again
         self.schema = self.getSchema()
         self.checkTables()
Esempio n. 5
0
 def __init__(self, path):
     Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path)
     self.foreign_keys = True
     try:
         self.schema = self.getSchema()
         self.checkTables()
         self.log.debug("Checking foreign keys...")
         foreign_key_error = self.execute(
             "PRAGMA foreign_key_check").fetchone()
         if foreign_key_error:
             raise Exception("Database foreign key error: %s" %
                             foreign_key_error)
     except Exception, err:
         self.log.error("Error loading content.db: %s, rebuilding..." %
                        Debug.formatException(err))
         self.close()
         os.unlink(path)  # Remove and try again
         Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path)
         self.foreign_keys = True
         self.schema = self.getSchema()
         self.checkTables()