def reloadMemoryTables(self,force=False):
        """
        Checks to see if memory tables need to be repopulated (by seeing if they are empty)
        and then does so if necessary.
        """
        existingCreateCodes = self.db.query("SELECT tablename,memoryCode FROM masterTableTable").fetchall();
        for row in existingCreateCodes:
            """
            For each table, it checks to see if the table is currently populated; if not,
            it runs the stored code to repopulate the table. (It checks length because
            memory tables are emptied on a restart).
            """
            tablename = row[0]
            try:
                cursor = self.db.query((tablename) %"SELECT count(*) FROM %s")
                currentLength = cursor.fetchall()[0][0]
                logging.debug("Current Length is %d" %currentLength)
            except:
                currentLength = 0
            if currentLength==0 or force:
                for query in splitMySQLcode(row[1]):
                    self.db.query(query)
dataset/ETHPy150Open Bookworm-project/BookwormDB/bookwormDB/CreateDatabase.py/BookwormSQLDatabase.reloadMemoryTables/swapped operands of `%`