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!")