def button_focus_click(self, MainWindow): if (self.checkBox_rec.checkState() == 2) and (self.flag == True): new_function.rec_command_to_file(self.test_box.currentText(), 'focus', self.current_dir) if (self.flag == True): new_function.command_to_terminal(self.ssh, 'focus') if (self.checkBox_desktop.checkState() == 2): new_function.load_image(self.session_web, self.image_label, self.current_dir, self.ip_edit)
def button_dot_click(self, MainWindow): # не реализовано в консоли if (self.checkBox_rec.checkState() == 2) and (self.flag == True): new_function.rec_command_to_file(self.test_box.currentText(), 'button "Dot"', self.current_dir) if (self.flag == True): new_function.command_to_terminal(self.ssh, 'button "Dot" ') if (self.checkBox_desktop.checkState() == 2): new_function.load_image(self.session_web, self.image_label, self.current_dir, self.ip_edit)
def sys_click(self, MainWindow): if (self.checkBox_rec.checkState() == 2) and (self.flag == True): new_function.rec_command_to_file(self.test_box.currentText(), 'system_menu', self.current_dir) if (self.flag == True): new_function.command_to_terminal(self.ssh, 'button -t 2 "Pause" ') time.sleep(1) if (self.checkBox_desktop.checkState() == 2): new_function.load_image(self.session_web, self.image_label, self.current_dir, self.ip_edit)
def button_connect_click(self, MainWindow): try: if self.flag == False: self.ssh = new_function.shh_connect(self.ip_edit.text(), self.login.text(), self.pass_web.text()) self.session_web = new_function.request_connect(self.ip_edit.text(), self.login.text(), self.pass_web.text()) if self.ssh == False: return self.label_error.setText("Ошибка подключения!!!") if self.checkBox_desktop.checkState() == 2: new_function.load_image(self.session_web, self.image_label, self.current_dir, self.ip_edit) self.button_connect.setText("Disconected") self.label_error.setText("") self.flag = True return if self.flag == True: self.ssh.close() self.session_web.close() self.button_connect.setText("Connect") self.flag = False return except: return self.label_error.setText("Ошибка соединения")