How to use the rich.traceback.install function in rich

To help you get started, we’ve selected a few rich examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nf-core / tools / nf_core / __main__.py View on Github external
def run_nf_core():
    # Set up the rich traceback
    rich.traceback.install(width=200, word_wrap=True)

    # Print nf-core header to STDERR
    stderr = rich.console.Console(file=sys.stderr)
    stderr.print("\n[green]{},--.[grey39]/[green],-.".format(" " * 42))
    stderr.print("[blue]          ___     __   __   __   ___     [green]/,-._.--~\\")
    stderr.print("[blue]    |\ | |__  __ /  ` /  \ |__) |__      [yellow]   }  {")
    stderr.print("[blue]    | \| |       \__, \__/ |  \ |___     [green]\`-._,-`-,")
    stderr.print("[green]                                          `._,._,'\n")
    stderr.print("[grey39]    nf-core/tools version {}".format(nf_core.__version__), highlight=False)
    try:
        is_outdated, current_vers, remote_vers = nf_core.utils.check_if_outdated()
        if is_outdated:
            stderr.print(
                "[bold bright_yellow]    There is a new version of nf-core/tools available! ({})".format(remote_vers),
                highlight=False,
            )
github AcidWeb / CurseBreaker / CurseBreaker.py View on Github external
def __init__(self):
        self.core = Core()
        self.session = PromptSession(reserve_space_for_menu=6, complete_in_thread=True)
        self.headless = False
        self.console = None
        self.table = None
        self.cfSlugs = None
        self.wowiSlugs = None
        self.completer = None
        self.os = platform.system()
        install()