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()
|
self.listDownloaded.clear()
|
||||||
|
|
||||||
for star in self.starDB.getAllStars():
|
for star in self.starDB.getAllStars():
|
||||||
self.listDownloaded.addItem(star[0])
|
self.listDownloaded.addItem(star)
|
||||||
|
|
||||||
def updateSequenceList(self, sourceSeqTouple):
|
def updateSequenceList(self, sourceSeqTouple):
|
||||||
self.listSequences.clear()
|
self.listSequences.clear()
|
||||||
@@ -347,8 +347,7 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
def btCountAllFlaresClicked(self):
|
def btCountAllFlaresClicked(self):
|
||||||
allStarsDictList = []
|
allStarsDictList = []
|
||||||
|
|
||||||
for star in self.starDB.getAllStars():
|
for starName in self.starDB.getAllStars():
|
||||||
starName = star[0]
|
|
||||||
sequences = self.starDB.getStarSequences(starName)
|
sequences = self.starDB.getStarSequences(starName)
|
||||||
infos = self.starDB.getStarInfos(starName)
|
infos = self.starDB.getStarInfos(starName)
|
||||||
for sourceSeq in sequences:
|
for sourceSeq in sequences:
|
||||||
|
|||||||
@@ -132,7 +132,10 @@ class StarDB():
|
|||||||
def getAllStars(self):
|
def getAllStars(self):
|
||||||
res = self.dbCursor.execute("""SELECT DISTINCT mainName FROM stars
|
res = self.dbCursor.execute("""SELECT DISTINCT mainName FROM stars
|
||||||
ORDER BY mainName""")
|
ORDER BY mainName""")
|
||||||
return res.fetchall()
|
resList = []
|
||||||
|
for s in res.fetchall():
|
||||||
|
resList.append(s[0])
|
||||||
|
return resList
|
||||||
|
|
||||||
def getStarSequences(self, mainName):
|
def getStarSequences(self, mainName):
|
||||||
res = self.dbCursor.execute(f"""SELECT sourceName, sequence FROM stars
|
res = self.dbCursor.execute(f"""SELECT sourceName, sequence FROM stars
|
||||||
|
|||||||
Reference in New Issue
Block a user