def _getthumbnails(self): """Downloads all thumbsnails.""" for i in range(len(self._threads)): with NamedTemporaryFile() as f: path = thumbnailpathfromimg(self._threads[i].imgurl()) print "Downloading `%s`" % path f.write(urlopen(path).read()) f.flush() img = QPixmap(f.name).scaled(192, 192, Qt.KeepAspectRatio) self._images[i] = img self.reset()