def refresh_plot(self): """ Update plot with data from DB. Note: very time consuming. """ #todo: how about 2d/3d contour, eh? self.statPlot.kanjiStats(Kanji.freq_stats()) self.update_stat_info()
def update_stat_info(self): """ Update statistics for active DB. Note: very time consuming. """ try: count, (picked, freqs), picked_count = \ Kanji.query.count(), Kanji.freq_stats(), Kanji.picked_count() self.statInfo.setText("Kanji in DB: <b>%d</b> | Max picked: <b>%d</b> | \ Max frequency: <b>%d</b> | Picked at least once: <b>%d</b>" % (count, max(picked), max(freqs), picked_count)) self.update() except ValueError: set.statInfo.setText("No data available yet!")