コード例 #1
0
 def accept(self):
     # Checks if all the fields have been filed
     if self.ui.pteCommand.toPlainText() == '':
         QtGui.QMessageBox.information(self,
                     self.tr('Information'),
                     self.tr('You must enter a command.'))
     elif re.search('rm [\-a-zA-Z]+f', self.ui.pteCommand.toPlainText()):
         QtGui.QMessageBox.information(self,
                     self.tr('Information'),
                     self.tr('You must not use dangerous commands.'))
     else:
         self.servers.rewind()
         servers = ServersPool()
         
         for k, v in self.servers:
             if self.ui.checkboxes[k].isChecked():
                 #servers[k] = self.servers[k]
                 id, trash = self.ui.comboboxes[k].itemData(self.ui.comboboxes[k].currentIndex()).toInt()
                 login, password = self.dblink.getAuthById(id)
                 
                 servers.add(k, self.servers[k].server.host, self.servers[k].server.port, self.servers[k].server.type, login, password)
         
         self.hide()
         serverResponse = ServerResponsePool(self.dblink, servers, self.ui.pteCommand.toPlainText(), self, self.parent)
         serverResponse.show()
コード例 #2
0
 def accept(self):
     self.hide()
     serverResponse = ServerResponsePool(self.servers, self.command, self.parent)
     serverResponse.show()