def doUpdate(self): nl = self.eplisttodict(self.pyvr.shows[self.show]) doupdate = False for i in self.pathObjmap.keys(): if i not in nl: # delete doupdate = True self.cd.delItem(self.pathObjmap[i]) del self.pathObjmap[i] for i in nl: if i in self.pathObjmap and self.shows[i] == nl[i]: continue doupdate = True if i in self.pathObjmap: # changed self.cd.delItem(self.pathObjmap[i]) self.pathObjmap[i] = self.cd.addItem(self.id, PYVRShow, i, url=self.pyvr.url, info=nl[i]) self.shows = nl # sort our children #self.sort(lambda x, y: cmp(x.title, y.title)) self.sort(lambda x, y: cmp(x.info['pos'], y.info['pos'])) if doupdate: Container.doUpdate(self) self.lastmodified = self.pyvr.lastmodified
def doUpdate(self): #traceback.print_stack(file=log.logfile) nl = self.genres.parse_genres() if nl == self.genre_list: return doupdate = False for i in self.pathObjmap.keys(): if i not in nl: # delete doupdate = True self.cd.delItem(self.pathObjmap[i]) del self.pathObjmap[i] for i in nl: if i in self.pathObjmap: continue doupdate = True self.pathObjmap[i] = self.cd.addItem(self.id, ShoutGenre, i, genre = i) self.genre_list = nl # sort our children self.sort(lambda x, y: cmp(x.title, y.title)) if doupdate: Container.doUpdate(self)
def doUpdate(self): #traceback.print_stack(file=log.logfile) stations = self.feeds.parse_stations() if stations == self.sl: return nl = self.genStations(stations) doupdate = False for i in self.pathObjmap.keys(): if i not in nl: # delete doupdate = True self.cd.delItem(self.pathObjmap[i]) del self.pathObjmap[i] for name, i in nl.iteritems(): if name in self.pathObjmap: if cmpStation(i, self.cd[self.pathObjmap[name]].station): continue # Didn't match, readd self.cd.delItem(self.pathObjmap[name]) del self.pathObjmap[name] doupdate = True self.pathObjmap[name] = self.cd.addItem(self.id, ShoutStation, '%sk-%s' % (i['Bitrate'], name), station = i) self.sl = stations # sort our children self.sort(lambda *a: stationwbitratecmp(*a)) if doupdate: Container.doUpdate(self)
def __init__(self, *args, **kwargs): self.pyvr = kwargs['pyvr'] del kwargs['pyvr'] self.show = kwargs['show'] del kwargs['show'] Container.__init__(self, *args, **kwargs) self.pathObjmap = {} self.shows = {} self.lastmodified = None
def __init__(self, *args, **kwargs): self.url = kwargs['url'] del kwargs['url'] Container.__init__(self, *args, **kwargs) self.pathObjmap = {} self.pend = None self.lastmodified = None self.newobjs = None self.objs = {} self.lastcheck = 0
def doUpdate(self): # We need to rescan this dir, and see if our children has # changed any. if self.indoUpdate: return #import traceback #traceback.print_stack() self.indoUpdate = True doupdate = False children = sets.Set(os.listdir(self.FSpath)) for i in self.pathObjmap.keys(): if i not in children: doupdate = True # delete self.cd.delItem(self.pathObjmap[i]) del self.pathObjmap[i] for i in children: if i in self.pathObjmap: continue # new object nf = dofileadd(self.cd, self.id, self.FSpath, i) if nf is not None: doupdate = True self.pathObjmap[i] = nf # sort our children self.sort(lambda x, y: cmp(x.title, y.title)) # Pass up to handle UpdateID if doupdate: # Calling StorageFolder.doUpdate results in calling # ourselves. Container.doUpdate(self) self.indoUpdate = False
def doUpdate(self): if self.newobjs is None: import traceback traceback.print_stack(file=log.logfile) return nl = self.newobjs doupdate = False for i in self.pathObjmap.keys(): if i not in nl: # delete doupdate = True self.cd.delItem(self.pathObjmap[i]) del self.pathObjmap[i] # This data is referenced when adding new shows self.shows = nl for i in nl: if i in self.pathObjmap: continue doupdate = True try: self.pathObjmap[i] = self.cd.addItem(self.id, PYVRShows, i, show=i, pyvr=self) except: import traceback traceback.print_exc(file=log.logfile) raise self.newobjs = None # sort our children self.sort(lambda x, y: cmp(x.title, y.title)) if doupdate: Container.doUpdate(self)
def __init__(self, *args, **kwargs): Container.__init__(self, *args, **kwargs) self.genres = GenreFeedAsync() self.genre_list = None self.pathObjmap = {}