コード例 #1
0
ファイル: ColorPrinterTest.py プロジェクト: abhsag24/PyPrint
    def test_printer_interface(self):
        uut = ColorPrinter()

        with self.assertRaises(NotImplementedError):
            uut.print("test")

        with self.assertRaises(NotImplementedError):
            uut.print("test", color="green")
コード例 #2
0
ファイル: ConsolePrinter.py プロジェクト: abhsag24/PyPrint
    def __init__(self, print_colored=None):
        """
        Instantiates a new ConsolePrinter.

        :param print_colored: Whether to print with colors or not. If None use
                              colors if supported.
        """
        ColorPrinter.__init__(self, print_colored)
        colorama.init()
コード例 #3
0
    def __init__(self, print_colored=None):
        """
        Instantiates a new ConsolePrinter.

        :param print_colored: Whether to print with colors or not. If None use
                              colors if supported.
        """
        ColorPrinter.__init__(self, print_colored)
        if not ConsolePrinter.colorama_initialized:
            colorama.init()
            ConsolePrinter.colorama_initialized = True
コード例 #4
0
ファイル: ConsolePrinter.py プロジェクト: andreimacavei/coala
 def __init__(self,
              print_colored=platform.system() in ("Linux",)):
     ColorPrinter.__init__(self, print_colored)