def refresh(self):
        if self.subscribed:
            self.title = u'Subscribed projects'
            if self.unreviewed:
                self.title += u' with unreviewed changes'
        else:
            self.title = u'All projects'
        self.app.status.update(title=self.title)
        with self.app.db.getSession() as session:
            i = 0
            for project in session.getProjects(topicless=True,
                    subscribed=self.subscribed, unreviewed=self.unreviewed):
                #self.log.debug("project: %s" % project.name)
                i = self._projectRow(i, project, None)
            for topic in session.getTopics():
                #self.log.debug("topic: %s" % topic.name)
                i = self._topicRow(i, topic)
                topic_unreviewed = 0
                topic_open = 0
                for project in topic.projects:
                    #self.log.debug("  project: %s" % project.name)
                    cache = self.app.project_cache.get(project)
                    topic_unreviewed += cache['unreviewed_changes']
                    topic_open += cache['open_changes']
                    if self.subscribed:
                        if not project.subscribed:
                            continue
                        if self.unreviewed and not cache['unreviewed_changes']:
                            continue
                    if topic.key in self.open_topics:
                        i = self._projectRow(i, project, topic)
                topic_row = self.topic_rows.get(topic.key)
                topic_row.update(topic, topic_unreviewed, topic_open)
        while i < len(self.listbox.body):
            current_row = self.listbox.body[i]
            self._deleteRow(current_row)
dataset/ETHPy150Open openstack/gertty/gertty/view/project_list.py/ProjectListView.refresh/original