(self, fix=False)
Verify database integrity.
Verify database integrity.
Verify database integrity .
def VerifyDatabase(self, fix=False):
    """Verify database integrity."""
    conn = self._Connect()
    try:
      q = conn.execute(APPLICATION_USAGE_TABLE_SELECT)
      unused_rows = q.fetchall()
      ok = True
    except sqlite3.Error:
      ok = False

    if not ok:
      if fix:
        print 'Recreating database.'
        print 'Recovered %d rows.' % self._RecreateDatabase()
      else:
        print 'Database is malformed.  Run with --fix to attempt repair.'
    else:
      print 'Database is OK.'
def VerifyDatabase ( self , fix = False ) : conn = self . _Connect ( ) try : q = conn . execute ( APPLICATION_USAGE_TABLE_SELECT ) unused_rows = q . fetchall ( ) ok = True except sqlite3 . Error : ok = False if not ok : if fix : print 'Recreating database.' print 'Recovered %d rows.' % self . _RecreateDatabase ( ) else : print 'Database is malformed.  Run with --fix to attempt repair.' else : print 'Database is OK.'