replace 'print()' with 'output.stderr_write("\n")'

This commit is contained in:
Mike Fährmann
2025-02-15 18:01:05 +01:00
parent 35307608f2
commit 800cf5beb5
4 changed files with 15 additions and 15 deletions

View File

@@ -9,7 +9,7 @@
"""Compare versions of the same file and replace/enumerate them on mismatch"""
from .common import PostProcessor
from .. import text, util, exception
from .. import text, util, output, exception
import os
@@ -83,7 +83,7 @@ class ComparePP(PostProcessor):
self._equal_cnt += 1
if self._equal_cnt >= self._equal_max:
util.remove_file(pathfmt.temppath)
print()
output.stderr_write("\n")
raise self._equal_exc()
pathfmt.delete = True

View File

@@ -9,7 +9,7 @@
"""Convert Pixiv Ugoira to WebM"""
from .common import PostProcessor
from .. import util
from .. import util, output
import subprocess
import tempfile
import zipfile
@@ -226,13 +226,13 @@ class UgoiraPP(PostProcessor):
if self._finalize:
self._finalize(pathfmt, tempdir)
except OSError as exc:
print()
output.stderr_write("\n")
self.log.error("Unable to invoke FFmpeg (%s: %s)",
exc.__class__.__name__, exc)
self.log.debug("", exc_info=exc)
pathfmt.realpath = pathfmt.temppath
except Exception as exc:
print()
output.stderr_write("\n")
self.log.error("%s: %s", exc.__class__.__name__, exc)
self.log.debug("", exc_info=exc)
pathfmt.realpath = pathfmt.temppath
@@ -296,7 +296,7 @@ class UgoiraPP(PostProcessor):
out = None if self.output else subprocess.DEVNULL
retcode = util.Popen(args, stdout=out, stderr=out).wait()
if retcode:
print()
output.stderr_write("\n")
self.log.error("Non-zero exit status when running %s (%s)",
args, retcode)
raise ValueError()