From a65b0edcd4735b4ab5c297ebf9404ab9eddd9647 Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Sat, 7 May 2016 21:12:08 +0200 Subject: [PATCH] Add QubesArgumentParser.print_error() --- qubes/tools/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qubes/tools/__init__.py b/qubes/tools/__init__.py index 013efeb3..c136dc61 100644 --- a/qubes/tools/__init__.py +++ b/qubes/tools/__init__.py @@ -25,10 +25,13 @@ '''Qubes' command line tools ''' +from __future__ import print_function + import argparse import importlib import logging import os +import sys import textwrap import qubes.log @@ -282,6 +285,11 @@ class QubesArgumentParser(argparse.ArgumentParser): elif verbose >= 1: qubes.log.enable() + # pylint: disable=no-self-use + def print_error(self, *args, **kwargs): + ''' Print to ``sys.stderr``''' + print(*args, file=sys.stderr, **kwargs) + def get_parser_for_command(command): '''Get parser for given qvm-tool.