def remove_reminder(self, prog): """ Remove the reminder for the specified program. """ key = get_prog_key(prog) if key in self.progs: del self.progs[key]
def check_reminders(self): """ Check to see if we should show a dialog if a program is about to start. """ now = time.time() for prog in self.progs.values(): if prog.start <= now: channel_name = tv.channels.map_channel_id_to_name(prog.channel_id) if prog.start == now: dialog.show_message(_('%s is starting now on %s') % (prog.name, channel_name)) elif prog.start >= now + config.REMIND_MINUTES_BEFORE: minutes = (prog.start - now) / 60 dialog.show_message(_('%s is about to start in %d minutes on %s') % (prog.name, minutes,channel_name)) if now > prog.start: del self.progs[get_prog_key(prog)]
def check_reminders(self): """ Check to see if we should show a dialog if a program is about to start. """ now = time.time() for prog in self.progs.values(): if prog.start <= now: channel_name = tv.channels.map_channel_id_to_name( prog.channel_id) if prog.start == now: dialog.show_message( _('%s is starting now on %s') % (prog.name, channel_name)) elif prog.start >= now + config.REMIND_MINUTES_BEFORE: minutes = (prog.start - now) / 60 dialog.show_message( _('%s is about to start in %d minutes on %s') % (prog.name, minutes, channel_name)) if now > prog.start: del self.progs[get_prog_key(prog)]
def is_reminder_set(self, prog): """ Check to see if a reminder has been set for the specified program, """ return get_prog_key(prog) in self.progs
def add_reminder(self, prog): """ Add a reminder for the specified program. """ self.progs[get_prog_key(prog)] = prog