def select(self): cur = self['list'].getCurrent() if cur and cur[-1]: album = cur[-1] title = cur[0] # NOTE: retrieve from array to be independent of underlaying API as the flickr and picasa albums are not compatible here thread = SimpleThread(lambda:self.api.getAlbum(album)) self.session.open(EcasaFeedview, thread, api=self.api, title=title)
def __init__(self, session): EcasaPictureWall.__init__(self, session) self.skinName = ["EcasaOverview", "EcasaPictureWall"] thread = SimpleThread(self.api.getFeatured) thread.deferred.addCallbacks(self.gotPictures, self.errorPictures) thread.start() self.onClose.append(self.__onClose)
def setupClosed(self): api = self.api EcasaPictureWall.setupClosed(self) if api != self.api: self.pictures = () self["highlight"].hide() for i in range(self.PICS_PER_PAGE): self['image%d' % i].instance.setPixmap(None) self["waitingtext"].show() thread = SimpleThread(self.api.getFeatured) thread.deferred.addCallbacks(self.gotPictures, self.errorPictures) thread.start()
def searchCallback(self, text=None): if text: # Maintain history history = config.plugins.ecasa.searchhistory.value if text not in history: history.insert(0, text) del history[10:] else: history.remove(text) history.insert(0, text) config.plugins.ecasa.searchhistory.save() thread = SimpleThread(lambda:self.api.getSearch(text, limit=str(config.plugins.ecasa.searchlimit.value))) self.session.open(EcasaFeedview, thread, api=self.api, title=_("Search for %s") % (text))
def acquireAlbumsForUser(self, user): thread = SimpleThread(lambda: self.api.getAlbums(user=user)) thread.deferred.addCallbacks(self.gotAlbums, self.errorAlbums) thread.start()
def __onClose(self): thread = SimpleThread(lambda: self.api.cleanupCache( config.plugins.ecasa.cachesize.value)) thread.start()
def parseEPGAsync(self, simulateOnly=False): t = SimpleThread(lambda: self.parseEPG(simulateOnly=simulateOnly)) t.start() return t.deferred