def add_blacklist_user(self, new_user): if new_user != '' and ' ' not in new_user: if any(new_user.lower() == name.lower() for name in self.user_blacklist): Message.name_in_list(self) else: self.user_blacklist.append(new_user) self.blacklist_users_listview.addItem(new_user) self.blacklist_users_listview.sortItems() else: Message.not_valid_name(self)
def add_subreddit(self, new_sub): """Adds the subreddit entered into the dialog to the subreddit list""" if new_sub != '' and ' ' not in new_sub: if any(new_sub.lower() == name.lower() for name in self.subreddit_watchlist): Message.name_in_list(self) else: self.subreddit_watchlist.append(new_sub) self.sub_watchlist_listview.addItem(new_sub) self.sub_watchlist_listview.sortItems() else: Message.not_valid_name(self)