pyGHDL.cli.dom
#
Classes
Application
: A mixin class (interface) to provide class-local terminal writing methods.
Classes
- class pyGHDL.cli.dom.Application[source]#
Inheritance
- _width: int#
Terminal width in characters
- _height: int#
Terminal height in characters
- Foreground = {'BLUE': '', 'CYAN': '', 'DARK_BLUE': '', 'DARK_CYAN': '', 'DARK_GRAY': '', 'DARK_GREEN': '', 'DARK_RED': '', 'DARK_YELLOW': '', 'ERROR': '', 'GRAY': '', 'GREEN': '', 'HEADLINE': '', 'MAGENTA': '', 'NOCOLOR': '', 'RED': '', 'WARNING': '', 'WHITE': '', 'YELLOW': ''}#
Terminal colors
- static GetAttributes(method, filter=<class 'pyAttributes.Attribute'>)#
Returns a list of pyAttributes attached to the given method.
- static GetTerminalSize()#
Returns the terminal size as tuple (width, height) for Windows, Mac OS (Darwin), Linux, cygwin (Windows), MinGW32/64 (Windows).
- static HasAttribute(method, filter=<class 'pyAttributes.Attribute'>)#
Returns true, if the given method has pyAttributes attached.
- property LogLevel: Severity#
Return the current minimal severity level for writing.
- property MainParser: ArgumentParser#
Returns the main parser.
- property SubParsers#
Returns the sub-parsers.
- property Terminal: Terminal#
Return the local terminal instance.
- WriteDebug(message, indent=2, appendLinebreak=True)#
Write a debug message if
condition
is true.
- WriteDryRun(message, indent=2, appendLinebreak=True)#
Write a dry-run message if
condition
is true.
- WriteError(message, indent=0, appendLinebreak=True)#
Write an error message if
condition
is true.
- WriteFatal(message, indent=0, appendLinebreak=True, immediateExit=True)#
Write a fatal message if
condition
is true.
- WriteInfo(message, indent=0, appendLinebreak=True)#
Write an info message if
condition
is true.
- WriteLine(line)#
Print a formatted line to the underlying terminal/console offered by the operating system.
- Return type:
- Parameters:
line (Line) –
- WriteNormal(message, indent=0, appendLinebreak=True)#
Write a normal message if
condition
is true.
- WriteQuiet(message, indent=0, appendLinebreak=True)#
Write a message even in quiet mode if
condition
is true.
- WriteVerbose(message, indent=1, appendLinebreak=True)#
Write a verbose message if
condition
is true.
- WriteWarning(message, indent=0, appendLinebreak=True)#
Write a warning message if
condition
is true.
- _LOG_MESSAGE_FORMAT__ = {Severity.Debug: '{DARK_GRAY}{message}{NOCOLOR}', Severity.Verbose: '{GRAY}{message}{NOCOLOR}', Severity.Normal: '{WHITE}{message}{NOCOLOR}', Severity.DryRun: '{DARK_CYAN}[DRY] {message}{NOCOLOR}', Severity.Info: '{WHITE}{message}{NOCOLOR}', Severity.Warning: '{YELLOW}[WARNING] {message}{NOCOLOR}', Severity.Quiet: '{WHITE}{message}{NOCOLOR}', Severity.Error: '{RED}[ERROR] {message}{NOCOLOR}', Severity.Fatal: '{DARK_RED}[FATAL] {message}{NOCOLOR}'}#
Message formatting rules.
- __new__(**kwargs)#
- classmethod deinitColors()#
Uninitialize the terminal for color support by colorama.
- Return type:
- classmethod exit(returnCode=0)#
Exit the terminal application by uninitializing color support and returning an exit code.
- classmethod fatalExit(returnCode=0)#
Exit the terminal application by uninitializing color support and returning a fatal exit code.
- classmethod printNotImplementedError(ex)#
Prints a not-implemented exception of type
NotImplementedError
.- Return type: