Ë
    ü[;j5  ã                   óh   — d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	 d	d„Z
d
d„Zy)z9General console printing utilities used by the Cloud SDK.é    N)Úconsole_attr)Úconsole_pager)Úencoding)Úfilesc                 ó2  — t         j                  j                  «       sy| rt         j                  j                  «       sy|rt         j                  j                  «       sy|r4t        j                  d«      }t        j                  d«      }|s|r|dk(  ryy)aí  Determines if the current terminal session is interactive.

  sys.stdin must be a terminal input stream.

  Args:
    output: If True then sys.stdout must also be a terminal output stream.
    error: If True then sys.stderr must also be a terminal output stream.
    heuristic: If True then we also do some additional heuristics to check if
               we are in an interactive context. Checking home path for example.

  Returns:
    True if the current terminal session is interactive.
  FÚHOMEÚHOMEPATHÚ/T)ÚsysÚstdinÚisattyÚstdoutÚstderrÚosÚgetenv)ÚoutputÚerrorÚ	heuristicÚhomeÚhomepaths        ú`G:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\fire/console/console_io.pyÚIsInteractiver      ss   € ô 
�‰×	Ñ	Ô	ØÙ”C—J‘J×%Ñ%Ô'ØÙ
”3—:‘:×$Ñ$Ô&Øáô �9‰9�VÓ€DÜ�y‰y˜Ó$€HÙ™T T¨S¢[ØØ	ó    c                 óä  — t        d¬«      s|j                  | «       y|�rªt        j                  t        j
                  dd«      }|dk(  rd}n"|s dD ]  }t        j                  |«      sŒ|} n |�rXt        j                  t        j
                  dd«      }d|xs d	z   }t        j                  t        j
                  d|«       t        j                  t        j                  t        j                  «       t        j                  |t        j                  d¬
«      }t        j                   «       j#                  «       }	|j%                  | j'                  |	«      ¬«       |j)                  «        t        j                  t        j                  t        j*                  «       |€%t        j                  t        j
                  dd«       yt-        j.                  | ||«      j1                  «        y)a  Run a user specified pager or fall back to the internal pager.

  Args:
    contents: The entire contents of the text lines to page.
    out: The output stream.
    prompt: The page break prompt.
    check_pager: Checks the PAGER env var and uses it if True.
  T)r   NÚPAGERÚ-)ÚlessÚpagerÚLESSz-RÚ )r   Úshell)Úinput)r   Úwriter   ÚGetEncodedValuer   Úenvironr   ÚFindExecutableOnPathÚSetEncodedValueÚsignalÚSIGINTÚSIG_IGNÚ
subprocessÚPopenÚPIPEr   ÚGetConsoleAttrÚGetEncodingÚcommunicateÚencodeÚwaitÚSIG_DFLr   ÚPagerÚRun)
ÚcontentsÚoutÚpromptÚcheck_pagerr   ÚcommandÚ	less_origr   ÚpÚencs
             r   ÚMorer>   D   s_  € ô 
˜dÕ	#Ø‡I�IˆhÔØ
ÚÜ×$Ñ$¤R§Z¡Z°¸$Ó?€EØ�‚|à�eÙã&ˆ'Ü×%Ñ% gÕ.Øˆ%Ù
ð 'ò ô ×*Ñ*¬2¯:©:°v¸tÓD€iØ�Y’_ "Ñ%€dÜ×ÑœrŸz™z¨6°4Ô8ô ‡m�m”F—M‘M¤6§>¡>Ô2Ü
×
Ñ
˜5¬
¯©¸tÔ
D€aÜ×'Ñ'Ó)×5Ñ5Ó7€cØ‡m�m˜(Ÿ/™/¨#Ó.€mÔ/Ø‡f�f„hä‡m�m”F—M‘M¤6§>¡>Ô2Ø	Ð	Ü× Ñ ¤§¡¨V°TÔ:Øä×Ñ�h  VÓ,×0Ñ0Õ2r   )FFF)NT)Ú__doc__r   r(   r+   r   Úfire.consoler   r   r   r   r   r>   © r   r   Ú<module>rB      s.   ðñ  @ã 	Û Û Û 
å %Ý &Ý !Ý ó$ôN*3r   