def _callback(self, input): """Evalute input and display the result (unless it's None).""" if input is None: # The user canceled. return result = eval(input) if result is not None: elinks.info_box(result, "Result")
def _tally(self, title, new, errors): """Record and report feed statistics.""" self._results[title] = (new, errors) if len(self._results) == len(self._feeds): feeds = self._results.keys() feeds.sort() width = max([len(title) for title in feeds]) fmt = "%*s new entries: %2d errors: %2d\n" summary = "" for title in feeds: new, errors = self._results[title] summary += fmt % (-width, title, new, errors) elinks.info_box(summary, "Feed Statistics")