def btn_delete_click_event(self): _index = self.ui.tb_posts.currentRow() DataBase.delete_post(self.datas[_index][0]) self.datas.pop(_index) self.__init_table_items()
def btn_add_click_event(self): _text = self.ui.input_text.text() DataBase.insert_ban(_text) self.ui.input_text.clear() self.__init_table_items()
def btn_delete_click_event(self): _index = self.ui.tb_keywords.currentRow() DataBase.delete_ban(self.datas[_index][0]) self.datas.pop(_index) self.ui.input_text.clear() self.__init_table_items()
def btn_fix_click_event(self): _index, _text = self.ui.tb_keywords.currentRow( ), self.ui.input_text.text() DataBase.update_ban(self.datas[_index][0], _text) self.ui.input_text.clear() self.__init_table_items()
def btn_ok_click_event(self): _title, _contents = self.ui.input_title.text( ), self.ui.input_contents.toPlainText() if self.isFix: DataBase.update_post(self.id, _title, _contents) else: DataBase.insert_post(_title, _contents) self.hide()
def __start_thread(self): self.web_crawling = Crawling( [_[1] for _ in DataBase.select_keyword_all()], # keyword [_[1] for _ in DataBase.select_ban_all()], # ban self.__play_sound, [ self.__init_tb_search_items, self.__init_tb_qna_total_items, self.__init_tb_qna_items, self.__init_tb_jn_items, self.__init_tb_gomin_items ]) self.web_crawling.daemon = True self.web_crawling.start() self.ui.btn_start.setText('검색 종료')
def __init_tb_ban_items(self): _datas = DataBase.select_ban_all() _len_datas = len(_datas) self.ui.tb_ban.clearContents() self.ui.tb_ban.setRowCount(_len_datas) for i, v in enumerate(_datas): self.ui.tb_ban.setItem(i, 0, QtWidgets.QTableWidgetItem(v[1]))
def __init_table_items(self): self.ui.tb_posts.clearContents() self.ui.tb_posts.setRowCount(0) self.datas = DataBase.select_post_all() for d in self.datas: self.__add_table_item(d[1], d[2])
def __init_table_items(self): self.ui.tb_keywords.clearContents() self.ui.tb_keywords.setRowCount(0) self.datas = DataBase.select_ban_all() for d in self.datas: self.__add_table_item(d[1])
def tb_answers_d_click_event(self, item): _data = DataBase.select_post_all() _tmp = _data[item.row()][2] _tmp.replace('\n', '\r\n') clipboard.copy(_tmp)