
    STh                         d dl Z d dlmZ ddlmZmZmZmZ e j                  dk(  rd dl	Z	 e	j                  d       d Zd Zd	 Zdd
Zy)    N)SimpleNamespace   )jupyternon_ttyttyvoidwin32 c                    t        || j                  d      | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  | j                        }|S )Nr   )interactivecursor_up_1writeflushcolscarriage_return
clear_lineclear_end_lineclear_end_screenhide_cursorshow_cursorfactory_cursor_up)r   r   r   r   r   r   r   r   r   r   r   )modr   terminals      k/home/www/backend.miabetepe.com/venv/lib/python3.12/site-packages/alive_progress/utils/terminal/__init__.py_creater      st    ))!, iiiiXX++>>))--OOOO//H  O    c                  t    dt         j                  vryddlm}   |        j                  j
                  }|dk7  S )a  This detection is tricky, because by design there's no way to tell which kind
    of frontend is connected, there may even be more than one with different types!
    Also, there may be other types I'm not aware of...
    So, I've chosen what I thought it was the safest method, with a negative logic:
    if it _isn't_ None or TerminalInteractiveShell, it should be the "jupyter" type.
    The jupyter type does not emit any ANSI Escape Codes.
    IPythonFr   )get_ipythonTerminalInteractiveShell)sysmodulesr   r   	__class____name__)r   class_s     r   _is_notebookr&   "   s5     ##]$$--F///r   c                  "    t        t        d      S )NF)r   r    r   r   get_voidr)   3   s    4r   c                 :   | t         j                  } t        j                  | |xs d      }|t	        | d      rC| j                         r3n|r0t        t               rt        j                  |      d      S |d      S t        t        j                  |      d      S )Nd   isattyTF)r!   stdoutr   newhasattrr,   r   r&   r   get_fromr   )file	force_ttyr   bases       r   get_termr4   7   s{    |zz774%D4=4EwtX4;;=9w''-4PPT4PP7##D)511r   )NNN)r!   typesr   r
   r   r   r   r   platformossystemr   r&   r)   r4   r(   r   r   <module>r9      sC    
 ! ) ) <<7BIIbM(0" 2r   