Heray-Was-Here
Server : Apache
System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User : jasonp18 ( 1000)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /proc/self/root/proc/3/root/opt/imh-python/lib/python3.9/site-packages/picotui/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/3/root/opt/imh-python/lib/python3.9/site-packages/picotui/context.py
from .screen import Screen


class Context:

    def __init__(self, cls=True, mouse=True):
        self.cls = cls
        self.mouse = mouse

    def __enter__(self):
        Screen.init_tty()
        if self.mouse:
            Screen.enable_mouse()
        if self.cls:
            Screen.cls()
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        if self.mouse:
            Screen.disable_mouse()
        Screen.goto(0, 50)
        Screen.cursor(True)
        Screen.deinit_tty()
        # This makes sure that entire screenful is scrolled up, and
        # any further output happens on a normal terminal line.
        print()

Hry