def _update(self): self.ctx['status'] = HeaderBar.status_desc[self.status] self.ctx['elapsed'] = util.humanize_time(self.time) if 'duration' in self.info: self.ctx['total'] = util.humanize_time(self.info['duration']) self.text.set_text(self.parser.eval(self.ctx)) self._invalidate() signals.emit('need-redraw')
def update(self): status_desc = {xmmsclient.PLAYBACK_STATUS_PLAY: 'PLAYING', xmmsclient.PLAYBACK_STATUS_STOP: 'STOPPED', xmmsclient.PLAYBACK_STATUS_PAUSE: 'PAUSED '} self.ctx['status'] = status_desc[self.status] self.ctx['elapsed'] = util.humanize_time(self.time) if 'duration' in self.info: self.ctx['total'] = util.humanize_time(self.info['duration']) self.progress.set_completion(float(self.time) / self.info['duration'] * 100) self.song.set_text(self.parser.eval(self.ctx))
def update(self): status_desc = { xmmsclient.PLAYBACK_STATUS_PLAY: 'PLAYING', xmmsclient.PLAYBACK_STATUS_STOP: 'STOPPED', xmmsclient.PLAYBACK_STATUS_PAUSE: 'PAUSED ' } self.ctx['status'] = status_desc[self.status] self.ctx['elapsed'] = util.humanize_time(self.time) if 'duration' in self.info: self.ctx['total'] = util.humanize_time(self.info['duration']) self.progress.set_completion( float(self.time) / self.info['duration'] * 100) self.song.set_text(self.parser.eval(self.ctx))
def run(self): while True: tasks_running = False gtk.gdk.threads_enter() for x in running_tasks_model: x[3] = util.humanize_time( datetime.datetime.now() - x[2] ) gtk.gdk.threads_leave() if tasks_running: time.sleep(1) else: time.sleep(10)
def run(self): while True: tasks_running = False gtk.gdk.threads_enter() for x in running_tasks_model: x[3] = util.humanize_time(datetime.datetime.now() - x[2]) gtk.gdk.threads_leave() if tasks_running: time.sleep(1) else: time.sleep(10)