diff options
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(): |
