self._log("Error: Invalid convert profile \"" + convertParams.convertProfile + "\".")
return
- if not self.checkConverter(convertParams.converterPath, self._CONVERTER_CHECK):
+ command: list[str] = [convertParams.converterPath] + [self._CONVERTER_CHECK]
+ result: subprocess.CompletedProcess
+
+ try:
+ result = subprocess.run(command, capture_output=True, text=True)
+ except:
self._log("Error: Could not start converter \"" + convertParams.converterPath + "\".")
return
+ if result.returncode != 0:
+ self._log("Error: Could not start converter \"" + convertParams.converterPath
+ + "\": " + result.stderr)
+ return
+
if convertParams.jobs < 1:
self._log("Error: Number of concurrent jobs must be at least 1.")
return
command: list[str] = ([converterPath] + [self._CONVERTER_IN]
+ [task.inputFilePath] + task.converterArgs
+ [outputFilePathWip])
- result: subprocess.CompletedProcess = subprocess.run(
- command, capture_output=True, text=True)
+ result: subprocess.CompletedProcess
+
+ try:
+ result = subprocess.run(command, capture_output=True, text=True)
+ except:
+ self._log("Error converting file \"" + task.inputFilePath
+ + "\" into \"" + task.outputFilePath + "\".")
+ stats.errors += 1
+ return
if result.returncode != 0:
self._log("Error from converter on file \""
def isFileIdentical(self, firstFilePath: str, secondFilePath: str) -> bool:
return filecmp.cmp(firstFilePath, secondFilePath, shallow=False)
-
- def checkConverter(self, converterPath: str, converterArg: str) -> bool:
- try:
- return subprocess.run([converterPath, converterArg],
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL).returncode == 0
- except:
- return False;
# /Converter
class GUI: