diff --git a/main/astrodatagui/AstrodataGUI.py b/main/astrodatagui/AstrodataGUI.py index 239ecdd..e0f071d 100644 --- a/main/astrodatagui/AstrodataGUI.py +++ b/main/astrodatagui/AstrodataGUI.py @@ -149,7 +149,7 @@ class AstrodataGUI(QtWidgets.QMainWindow): self.listDownloaded.clear() for star in self.starDB.getAllStars(): - self.listDownloaded.addItem(star[0]) + self.listDownloaded.addItem(star) def updateSequenceList(self, sourceSeqTouple): self.listSequences.clear() @@ -347,8 +347,7 @@ class AstrodataGUI(QtWidgets.QMainWindow): def btCountAllFlaresClicked(self): allStarsDictList = [] - for star in self.starDB.getAllStars(): - starName = star[0] + for starName in self.starDB.getAllStars(): sequences = self.starDB.getStarSequences(starName) infos = self.starDB.getStarInfos(starName) for sourceSeq in sequences: diff --git a/main/astrodatagui/db/StarsDB.py b/main/astrodatagui/db/StarsDB.py index 4b9a8f2..39bdf64 100644 --- a/main/astrodatagui/db/StarsDB.py +++ b/main/astrodatagui/db/StarsDB.py @@ -132,7 +132,10 @@ class StarDB(): def getAllStars(self): res = self.dbCursor.execute("""SELECT DISTINCT mainName FROM stars ORDER BY mainName""") - return res.fetchall() + resList = [] + for s in res.fetchall(): + resList.append(s[0]) + return resList def getStarSequences(self, mainName): res = self.dbCursor.execute(f"""SELECT sourceName, sequence FROM stars