def nextArt(self): if self._currentArtIndex < len(self._ALBUMS) - 1: self._currentArtIndex += 1 else: self._currentArtIndex = 0 albumInfo = self._ALBUMS[self._currentArtIndex] album = AnAlbum(albumInfo[0], albumInfo[1], fetch=False) album.fetchMetadata() self._art = album.arts[-1] self._art.downloadComplete.connect(self.showImage) self._art.downloadProgress.connect(self.showProgress) self._art.download(blocking=False)
def __init__(self, parent=None): super(Demo, self).__init__(parent) self.setWindowTitle("Asynchronus") self.setFixedSize(100,100) self.show() self.raise_() album = AnAlbum('Weezer', 'Green', fetch=False) album.fetchMetadata() self._art = album.arts[-1] self._art.downloadComplete.connect(self.showImage) self._art.downloadProgress.connect(self.showProgress) self._art.download(blocking=False)