diff options
| author | 2021-06-05 20:55:36 -0400 | |
|---|---|---|
| committer | 2021-06-05 20:55:36 -0400 | |
| commit | 8a644b7a06c504263a478d3681eed10b4161b5be (patch) | |
| tree | b3d668588e5c0be8c75467e50499f73ff9ec7c05 /gallery_dl/output.py | |
| parent | e7eb1f9779f2e223575ab23a6bc1abf2222e7d27 (diff) | |
New upstream version 1.17.5.upstream/1.17.5
Diffstat (limited to 'gallery_dl/output.py')
| -rw-r--r-- | gallery_dl/output.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gallery_dl/output.py b/gallery_dl/output.py index 2d3dc17..7e1f8c1 100644 --- a/gallery_dl/output.py +++ b/gallery_dl/output.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2015-2020 Mike Fährmann +# Copyright 2015-2021 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -232,15 +232,19 @@ def select(): } omode = config.get(("output",), "mode", "auto").lower() if omode in pdict: - return pdict[omode]() + output = pdict[omode]() elif omode == "auto": if hasattr(sys.stdout, "isatty") and sys.stdout.isatty(): - return ColorOutput() if ANSI else TerminalOutput() + output = ColorOutput() if ANSI else TerminalOutput() else: - return PipeOutput() + output = PipeOutput() else: raise Exception("invalid output mode: " + omode) + if not config.get(("output",), "skip", True): + output.skip = util.identity + return output + class NullOutput(): |
