add 'output.skip' option

pull/1550/head
Mike Fährmann 3 years ago
parent c5ca7905ce
commit e300da1424
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -2081,6 +2081,16 @@ Description
on one console line.
output.skip
-----------
Type
``bool``
Default
``true``
Description
Show skipped file downloads.
output.progress
---------------
Type

@ -320,6 +320,7 @@
"mode": "auto",
"progress": true,
"shorten": true,
"skip": true,
"log": "[{name}][{levelname}] {message}",
"logfile": null,
"unsupportedfile": null

@ -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():

Loading…
Cancel
Save