diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-04 03:31:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-04 03:31:41 +0000 |
commit | 72b8c35be4293bd21de123854491c658c53af100 (patch) | |
tree | 735464cc081879561927a37650b1102beaa1f4f9 /gitlint/display.py | |
parent | Adding upstream version 0.16.0. (diff) | |
download | gitlint-72b8c35be4293bd21de123854491c658c53af100.tar.xz gitlint-72b8c35be4293bd21de123854491c658c53af100.zip |
Adding upstream version 0.17.0.upstream/0.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gitlint/display.py')
-rw-r--r-- | gitlint/display.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/gitlint/display.py b/gitlint/display.py deleted file mode 100644 index c9bcb01..0000000 --- a/gitlint/display.py +++ /dev/null @@ -1,36 +0,0 @@ -from sys import stdout, stderr - - -class Display: - """ Utility class to print stuff to an output stream (stdout by default) based on the config's verbosity """ - - def __init__(self, lint_config): - self.config = lint_config - - def _output(self, message, verbosity, exact, stream): - """ Output a message if the config's verbosity is >= to the given verbosity. If exact == True, the message - will only be outputted if the given verbosity exactly matches the config's verbosity. """ - if exact: - if self.config.verbosity == verbosity: - stream.write(message + "\n") - else: - if self.config.verbosity >= verbosity: - stream.write(message + "\n") - - def v(self, message, exact=False): # pylint: disable=invalid-name - self._output(message, 1, exact, stdout) - - def vv(self, message, exact=False): # pylint: disable=invalid-name - self._output(message, 2, exact, stdout) - - def vvv(self, message, exact=False): # pylint: disable=invalid-name - self._output(message, 3, exact, stdout) - - def e(self, message, exact=False): # pylint: disable=invalid-name - self._output(message, 1, exact, stderr) - - def ee(self, message, exact=False): # pylint: disable=invalid-name - self._output(message, 2, exact, stderr) - - def eee(self, message, exact=False): # pylint: disable=invalid-name - self._output(message, 3, exact, stderr) |