libcopp  2.2.0
Public Member Functions | Static Public Attributes
print_color.Win32ConsoleColor Class Reference
Collaboration diagram for print_color.Win32ConsoleColor:
Collaboration graph

Public Member Functions

def get_cmd_color (self, handle=std_out_handle)
 
def set_cmd_color (self, color, handle=std_out_handle)
 
def stdout_with_color (self, options, text)
 
def stderr_with_color (self, options, text)
 

Static Public Attributes

string name = "windows console"
 
int STD_INPUT_HANDLE = -10
 
int STD_OUTPUT_HANDLE = -11
 
int STD_ERROR_HANDLE = -12
 
int FOREGROUND_BLACK = 0x0
 
int FOREGROUND_BLUE = 0x01
 
int FOREGROUND_GREEN = 0x02
 
int FOREGROUND_RED = 0x04
 
int FOREGROUND_INTENSITY = 0x08
 
int BACKGROUND_BLUE = 0x10
 
int BACKGROUND_GREEN = 0x20
 
int BACKGROUND_RED = 0x40
 
int BACKGROUND_INTENSITY = 0x80
 
dictionary COLOR_MAP
 
 std_out_handle = None
 
 std_err_handle = None
 

Detailed Description

Definition at line 48 of file print_color.py.

Member Function Documentation

◆ get_cmd_color()

def print_color.Win32ConsoleColor.get_cmd_color (   self,
  handle = std_out_handle 
)

◆ set_cmd_color()

def print_color.Win32ConsoleColor.set_cmd_color (   self,
  color,
  handle = std_out_handle 
)
(color) -> bit
Example: set_cmd_color(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY)

Definition at line 98 of file print_color.py.

Referenced by print_color.Win32ConsoleColor.stderr_with_color(), and print_color.Win32ConsoleColor.stdout_with_color().

◆ stderr_with_color()

def print_color.Win32ConsoleColor.stderr_with_color (   self,
  options,
  text 
)

◆ stdout_with_color()

def print_color.Win32ConsoleColor.stdout_with_color (   self,
  options,
  text 
)

Field Documentation

◆ BACKGROUND_BLUE

int print_color.Win32ConsoleColor.BACKGROUND_BLUE = 0x10
static

Definition at line 60 of file print_color.py.

◆ BACKGROUND_GREEN

int print_color.Win32ConsoleColor.BACKGROUND_GREEN = 0x20
static

Definition at line 61 of file print_color.py.

◆ BACKGROUND_INTENSITY

int print_color.Win32ConsoleColor.BACKGROUND_INTENSITY = 0x80
static

Definition at line 63 of file print_color.py.

◆ BACKGROUND_RED

int print_color.Win32ConsoleColor.BACKGROUND_RED = 0x40
static

Definition at line 62 of file print_color.py.

◆ COLOR_MAP

dictionary print_color.Win32ConsoleColor.COLOR_MAP
static
Initial value:
= {
print_style.FC_BLACK: FOREGROUND_BLACK,
print_style.FC_BLUE: FOREGROUND_BLUE | FOREGROUND_INTENSITY,
print_style.FC_GREEN: FOREGROUND_GREEN | FOREGROUND_INTENSITY,
print_style.FC_CYAN:
FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
print_style.FC_RED: FOREGROUND_RED | FOREGROUND_INTENSITY,
print_style.FC_MAGENTA:
FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
print_style.FC_YELLOW:
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY,
print_style.FC_WHITE:
FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED,
print_style.BC_BLACK: FOREGROUND_BLACK,
print_style.BC_BLUE: BACKGROUND_BLUE,
print_style.BC_GREEN: BACKGROUND_GREEN,
print_style.BC_CYAN: BACKGROUND_BLUE | BACKGROUND_GREEN,
print_style.BC_RED: BACKGROUND_RED,
print_style.BC_MAGENTA: BACKGROUND_RED | BACKGROUND_BLUE,
print_style.BC_YELLOW: BACKGROUND_RED | BACKGROUND_GREEN,
print_style.BC_WHITE:
BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE,
print_style.FW_BOLD: BACKGROUND_INTENSITY,
}

Definition at line 65 of file print_color.py.

◆ FOREGROUND_BLACK

int print_color.Win32ConsoleColor.FOREGROUND_BLACK = 0x0
static

Definition at line 54 of file print_color.py.

◆ FOREGROUND_BLUE

int print_color.Win32ConsoleColor.FOREGROUND_BLUE = 0x01
static

Definition at line 55 of file print_color.py.

◆ FOREGROUND_GREEN

int print_color.Win32ConsoleColor.FOREGROUND_GREEN = 0x02
static

Definition at line 56 of file print_color.py.

◆ FOREGROUND_INTENSITY

int print_color.Win32ConsoleColor.FOREGROUND_INTENSITY = 0x08
static

Definition at line 58 of file print_color.py.

◆ FOREGROUND_RED

int print_color.Win32ConsoleColor.FOREGROUND_RED = 0x04
static

Definition at line 57 of file print_color.py.

◆ name

string print_color.Win32ConsoleColor.name = "windows console"
static

Definition at line 49 of file print_color.py.

◆ std_err_handle

print_color.Win32ConsoleColor.std_err_handle = None
static

Definition at line 91 of file print_color.py.

Referenced by print_color.Win32ConsoleColor.stderr_with_color().

◆ STD_ERROR_HANDLE

int print_color.Win32ConsoleColor.STD_ERROR_HANDLE = -12
static

Definition at line 52 of file print_color.py.

◆ STD_INPUT_HANDLE

int print_color.Win32ConsoleColor.STD_INPUT_HANDLE = -10
static

Definition at line 50 of file print_color.py.

◆ std_out_handle

print_color.Win32ConsoleColor.std_out_handle = None
static

Definition at line 90 of file print_color.py.

Referenced by print_color.Win32ConsoleColor.stdout_with_color().

◆ STD_OUTPUT_HANDLE

int print_color.Win32ConsoleColor.STD_OUTPUT_HANDLE = -11
static

Definition at line 51 of file print_color.py.


The documentation for this class was generated from the following file: