OpenQuizz
Une application de gestion des contenus pédagogiques
AnsiToWin32 Class Reference
Inheritance diagram for AnsiToWin32:
Collaboration diagram for AnsiToWin32:

Public Member Functions

def __init__ (self, wrapped, convert=None, strip=None, autoreset=False)
 
def should_wrap (self)
 
def get_win32_calls (self)
 
def write (self, text)
 
def reset_all (self)
 
def write_and_convert (self, text)
 
def write_plain_text (self, text, start, end)
 
def convert_ansi (self, paramstring, command)
 
def extract_params (self, command, paramstring)
 
def call_win32 (self, command, params)
 
def convert_osc (self, text)
 

Data Fields

 wrapped
 
 autoreset
 
 stream
 
 strip
 
 convert
 
 win32_calls
 
 on_stderr
 

Static Public Attributes

 ANSI_CSI_RE
 
 ANSI_OSC_RE
 

Detailed Description

Implements a 'write()' method which, on Windows, will strip ANSI character
sequences from the text, and if outputting to a tty, will convert them into
win32 function calls.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  wrapped,
  convert = None,
  strip = None,
  autoreset = False 
)

Member Function Documentation

◆ call_win32()

def call_win32 (   self,
  command,
  params 
)

◆ convert_ansi()

def convert_ansi (   self,
  paramstring,
  command 
)

◆ convert_osc()

def convert_osc (   self,
  text 
)

◆ extract_params()

def extract_params (   self,
  command,
  paramstring 
)

◆ get_win32_calls()

def get_win32_calls (   self)

◆ reset_all()

def reset_all (   self)

◆ should_wrap()

def should_wrap (   self)
True if this class is actually needed. If false, then the output
stream will not be affected, nor will win32 calls be issued, so
wrapping stdout is not actually required. This will generally be
False on non-Windows platforms, unless optional functionality like
autoreset has been requested using kwargs to init()

◆ write()

def write (   self,
  text 
)

◆ write_and_convert()

def write_and_convert (   self,
  text 
)
Write the given text to our wrapped stream, stripping any ANSI
sequences from the text, and optionally converting them into win32
calls.

◆ write_plain_text()

def write_plain_text (   self,
  text,
  start,
  end 
)

Field Documentation

◆ ANSI_CSI_RE

ANSI_CSI_RE
static

◆ ANSI_OSC_RE

ANSI_OSC_RE
static

◆ autoreset

autoreset

◆ convert

convert

◆ on_stderr

on_stderr

◆ stream

stream

◆ strip

strip

◆ win32_calls

win32_calls

◆ wrapped

wrapped

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