astrodatagui: StarsDB: getAllStars: return dictionary instead of ambigous array
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user