Beispiel #1
0
 def _saveOutput(self):
     '''
     Saves console output to a selected file.
     '''
     log.debug("Saving console output")
     path = dialogs.runSaveFile("Text files (*.txt);;All files (*)")
     if path is None:
         return
     try:
         summary = open(path, "w")
         summary.write(self._textEdit.toPlainText())
         summary.close()
     except EnvironmentError, ex:
         dialogs.runError("Error occurred while writing to file %s:\n%s" %
                          (path, ex[1]))
Beispiel #2
0
 def _saveOutput(self):
     '''
     Saves console output to a selected file.
     '''
     log.debug("Saving console output")
     path = dialogs.runSaveFile("Text files (*.txt);;All files (*)")
     if path is None:
         return
     try:
         summary = open(path, "w")
         summary.write(self._textEdit.toPlainText())
         summary.close()
     except EnvironmentError, ex:
         dialogs.runError("Error occurred while writing to file %s:\n%s"
                          % (path, ex[1]))
Beispiel #3
0
 def saveAll(self):
     '''
     Sends a recursive request for root accessible that will be dumped
     to file.
     '''
     if not self._active:
         return
     filePath = dialogs.runSaveFile("XML files (*.xml);;All files (*)")
     if filePath is None:
         return
     path = accessible.Path()
     log.debug("Dumping accessible %s to file '%s'" % (path, filePath))
     id = self.device.requestDevice("requestAccessible", path, -1, all=True)
     self._registerRequest(id, self._responseSave, filePath)
     self._runProgress(id, "Dumping path: %s" % path,
                       timeout=self._TIMEOUT_DUMP_ALL)
Beispiel #4
0
 def saveAll(self):
     '''
     Sends a recursive request for root accessible that will be dumped
     to file.
     '''
     if not self._active:
         return
     filePath = dialogs.runSaveFile("XML files (*.xml);;All files (*)")
     if filePath is None:
         return
     path = accessible.Path()
     log.debug("Dumping accessible %s to file '%s'" % (path, filePath))
     id = self.device.requestDevice("requestAccessible", path, -1, all=True)
     self._registerRequest(id, self._responseSave, filePath)
     self._runProgress(id,
                       "Dumping path: %s" % path,
                       timeout=self._TIMEOUT_DUMP_ALL)
Beispiel #5
0
 def save(self):
     '''
     Sends a recursive request for accessible that will be dumped to file.
     '''
     if not self._active:
         return
     items = self._treeWidget.selectedItems()
     if not items:
         return
     path = self._itemPath(items[0])
     if not path:
         return
     filePath = dialogs.runSaveFile("XML files (*.xml);;All files (*)",
                                    items[0].text(1))
     if filePath is None:
         return
     log.debug("Dumping accessible %s to file '%s'" % (path, filePath))
     id = self.device.requestDevice("requestAccessible", path, -1, all=True)
     self._registerRequest(id, self._responseSave, filePath)
     self._runProgress(id, "Dumping path: %s" % path,
                       timeout=self._TIMEOUT_DUMP)
Beispiel #6
0
 def save(self):
     '''
     Sends a recursive request for accessible that will be dumped to file.
     '''
     if not self._active:
         return
     items = self._treeWidget.selectedItems()
     if not items:
         return
     path = self._itemPath(items[0])
     if not path:
         return
     filePath = dialogs.runSaveFile("XML files (*.xml);;All files (*)",
                                    items[0].text(1))
     if filePath is None:
         return
     log.debug("Dumping accessible %s to file '%s'" % (path, filePath))
     id = self.device.requestDevice("requestAccessible", path, -1, all=True)
     self._registerRequest(id, self._responseSave, filePath)
     self._runProgress(id,
                       "Dumping path: %s" % path,
                       timeout=self._TIMEOUT_DUMP)