def launch_FitWidget(self): if not self.Fit_Widget_running: QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) self.Fit_Widget = QProcess() self.Fit_Widget.start('python ./XAnoS_Fit.py') self.Fit_Widget_running = True self.Start_Data_Fitting_PushButton.setText('Running') self.Fit_Widget.finished.connect(self.stop_FitWidget) QApplication.restoreOverrideCursor()
def launch_ASAXSWidget(self): if not self.ASAXS_Widget_running: QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) self.ASAXS_Widget = QProcess() self.ASAXS_Widget.start('python ./XAnoS_Components.py') self.ASAXS_Widget_running = True self.Start_ASAXS_Reducer_PushButton.setText('Running') self.ASAXS_Widget.finished.connect(self.stop_ASAXSWidget) QApplication.restoreOverrideCursor()
def launch_Data_Reduction_Client(self): if not self.Data_Reduction_Client_running: QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) self.Data_Reduction_Client = QProcess() self.Data_Reduction_Client.start('python ./XAnoS_Reducer.py') self.Data_Reduction_Client_running = True self.Start_Data_Reduction_Client_PushButton.setText('Running') self.Data_Reduction_Client.finished.connect( self.stop_Data_Reduction_Client) QApplication.restoreOverrideCursor()
def launch_Data_Collector_Server(self): if not self.Data_Collector_Server_running: QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) self.Data_Collector_Server = QProcess() self.Data_Collector_Server.start('python ./XAnoS_Collector.py') self.Data_Collector_Server_running = True self.Start_Data_Collector_Server_PushButton.setText('Running') self.Data_Collector_Server.finished.connect( self.stop_Data_Collector_Server) QApplication.restoreOverrideCursor()
def launch_ASAXS_Batch_Processor_1(self): if not self.ASAXS_Batch_Processor_1_running: QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) self.ASAXS_Batch_Processor_1 = QProcess() self.ASAXS_Batch_Processor_1.start( 'python ./XAnoS_Batch_Processor_1.py') self.ASAXS_Batch_Processor_1_running = True self.Start_ASAXS_Batch_Processor_1_PushButton.setText('Running') self.ASAXS_Batch_Processor_1.finished.connect( self.stop_ASAXS_Batch_Processor_1) QApplication.restoreOverrideCursor()
def __init__(self,parent = None): super(Compress,self).__init__(parent) self.createList() self._process = QProcess(self) self._thread = QThread() self.moveToThread(self._thread) self._thread.start() self._fileName = "" self._outPath = "" self.startRunning.connect(self.startCompress) self._process.readyReadStandardOutput.connect(self.readMsg) self._process.readyReadStandardError.connect(self.readError) self._process.finished.connect(self.finished)
def open_directory(self): abs_path = os.getcwd() our_path = os.path.join(abs_path, 'Выгрузка') process = QProcess(MainWindow) process.start(f"explorer.exe {our_path}") MainWindow.close()
def prince_convert(self): ''' Call the actual Prince command to convert to PDF ''' from os import makedirs from os.path import dirname, join, exists from calibre.ptempfile import PersistentTemporaryFile from calibre.constants import DEBUG from shlex import split as shsplit # All files are relative to the OPF location opf_dir = dirname(self.opf) base_dir = dirname(self.pdf_file) base_dir = join(opf_dir, base_dir) try: makedirs(base_dir) except BaseException: if not exists(base_dir): raise # Create a temporary CSS file with the box contents custom_CSS = PersistentTemporaryFile(mode='w+') custom_CSS.write(unicode(self.css1.toPlainText())) custom_CSS.close() # Create a temporary file with the list of input files file_list = PersistentTemporaryFile(mode='w+') for item in self.oeb.spine: file_list.write(item.href + "\n") file_list.close() # Build the command line command = prefs['prince_exe'] args = ['-v'] if self.prince_file: args.append('-s') args.append(self.prince_file) args.append('-s') args.append(custom_CSS.name) args.append('-l') args.append(file_list.name) args.append('-o') args.append(self.pdf_file) # Additional command-line arguments args.extend(shsplit(self.args.text())) # Hide the convert button and show a busy indicator self.convert.setEnabled(False) self.progress_bar = QProgressBar() self.progress_bar.setRange(0, 0) self.progress_bar.setValue(0) self.l.addWidget(self.progress_bar) # Run the command and return the path to the PDF file if DEBUG: print(_('Converting book...')) process = QProcess(self) process.setWorkingDirectory(opf_dir) process.setProcessChannelMode(QProcess.MergedChannels) process.error.connect(self.error) process.finished.connect(self.end) self.process = process if DEBUG: from subprocess import list2cmdline line = list2cmdline([command] + args) print(_('Command line: %s') % line) process.start(command, args)