§
    ¯eîi5  ã                   ój   — 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dS )z9General console printing utilities used by the Cloud SDK.é    N)Úconsole_attr)Úconsole_pager)Úencoding)ÚfilesFc                 ó:  — t           j                             ¦   «         sdS | r t           j                             ¦   «         sdS |r t           j                             ¦   «         sdS |r4t          j        d¦  «        }t          j        d¦  «        }|s
|r|dk    rdS dS )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        ú[/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/fire/console/console_io.pyÚIsInteractiver      s¬   € õ 
Œ×	Ò	Ñ	Ô	ð Øˆ5Øð •C”J×%Ò%Ñ'Ô'ð Øˆ5Ø
ð •3”:×$Ò$Ñ&Ô&ð Øˆ5àð õ Œ9�VÑÔ€DÝŒy˜Ñ$Ô$€HØð ˜Tð  T¨S¢[ [ØˆUØ	ˆó    Tc                 óÀ  — t          d¬¦  «        s|                     | ¦  «         dS |�r‹t          j        t          j        dd¦  «        }|dk    rd}n|sdD ]}t          j        |¦  «        r|} nŒ|�r@t          j        t          j        dd¦  «        }d|pd	z   }t          j        t          j        d|¦  «         t          j	        t          j
        t          j        ¦  «         t          j        |t          j        d¬
¦  «        }t          j        ¦   «                              ¦   «         }	|                     |                      |	¦  «        ¬¦  «         |                     ¦   «          t          j	        t          j
        t          j        ¦  «         |€ t          j        t          j        dd¦  «         dS t-          j        | ||¦  «                             ¦   «          dS )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ÑÔÐØ
€FØñ ÝÔ$¥R¤Z°¸$Ñ?Ô?€EØ�‚|€|à€e€eØð à&ð ð ˆ'ÝÔ% gÑ.Ô.ð 	Øˆ%Ø
ˆ%ð	ð ñ õ Ô*­2¬:°v¸tÑDÔD€iØ�Y�_ "Ñ%€dÝÔ�rœz¨6°4Ñ8Ô8Ð8õ „m•F”M¥6¤>Ñ2Ô2Ð2Ý
Ô
˜5­
¬¸tÐ
DÑ
DÔ
D€aÝÔ'Ñ)Ô)×5Ò5Ñ7Ô7€cØ‡m‚m˜(Ÿ/š/¨#Ñ.Ô.€mÑ/Ô/Ð/Ø‡f‚f�h„h€hå„m•F”M¥6¤>Ñ2Ô2Ð2Ø	Ð	ÝÔ ¥¤¨V°TÑ:Ô:Ð:Ø€fåÔ�h  VÑ,Ô,×0Ò0Ñ2Ô2Ð2Ð2Ð2r   )FFF)NT)Ú__doc__r   r(   r+   r   Úfire.consoler   r   r   r   r   r>   © r   r   ú<module>rB      s°   ðð  @Ð ?à 	€	€	€	Ø €€€Ø Ð Ð Ð Ø 
€
€
€
à %Ð %Ð %Ð %Ð %Ð %Ø &Ð &Ð &Ð &Ð &Ð &Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð ð$ð $ð $ð $ðN*3ð *3ð *3ð *3ð *3ð *3r   