§
    WŠtj9  ã                   ó¬   — d dl Z d dlZddlmZmZ ddlmZmZ  ej        dej	        ¦  «        Z
dd„Zd	„ Z ej        d
¦  «        dhfgZd„ Zd„ Zdd„ZdS )é    Né   )ÚSHELL_NAMESÚShellDetectionFailureé   )ÚprocÚpsad  qemu-
        (alpha
        |armeb
        |arm
        |m68k
        |cris
        |i386
        |x86_64
        |microblaze
        |mips
        |mipsel
        |mips64
        |mips64el
        |mipsn32
        |mipsn32el
        |nios2
        |ppc64
        |ppc
        |sh4eb
        |sh4
        |sparc
        |sparc32plus
        |sparc64
    )é
   c                 ó˜   — t           t          fD ]-}	 |                     | |¦  «        }n# t          $ r Y Œ&w xY w|c S t	          d¦  «        ‚)z¡Select a way to obtain process information from the system.

    * `/proc` is used if supported.
    * The system `ps` utility is used as a fallback option.
    z,compatible proc fs or ps utility is required)r   r   Úiter_process_parentsÚEnvironmentErrorr   )ÚpidÚ	max_depthÚimplÚiterators       úX/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/shellingham/posix/__init__.pyÚ_iter_process_parentsr   %   sk   € õ •r�
ð ð ˆð	Ø×0Ò0°°iÑ@Ô@ˆHˆHøÝð 	ð 	ð 	ØˆHð	øøøàˆˆˆÝ
Ð NÑ
OÔ
OÐOs   ’)©
6µ6c                 óÆ   — t           j                             dd¦  «        }|r|} n
| dd…         } t           j                             | ¦  «                             ¦   «         | fS )z6Form shell information from SHELL environ if possible.ÚSHELLÚ r   N)ÚosÚenvironÚgetÚpathÚbasenameÚlower)Úproc_cmdÚlogin_shells     r   Ú_get_login_shellr   4   sZ   € å”*—.’. ¨"Ñ-Ô-€KØð  Øˆˆà˜A˜B˜B”<ˆÝŒG×Ò˜XÑ&Ô&×,Ò,Ñ.Ô.°Ð9Ð9ó    z^python(\d+(\.\d+)?)?$Úxonshc                 ó  — t           D ]|\  }}|                     | ¦  «        sŒ|D ]^}t          j                             |¦  «                             ¦   «         }t          j                             |¦  «        r||v r||fc c S Œ_Œ}dS )aV  Get shell invoked via an interpreter.

    Some shells are implemented on, and invoked with an interpreter, e.g. xonsh
    is commonly executed with an executable Python script. This detects what
    script the interpreter is actually running, and check whether that looks
    like a shell.

    See sarugaku/shellingham#26 for rational.
    N)Ú_INTERPRETER_SHELL_NAMESÚmatchr   r   r   r   Úisfile)Ú	proc_nameÚ	proc_argsÚpatternÚshell_namesÚargÚnames         r   Ú_get_interpreter_shellr+   C   s¢   € õ !9ð #ð #Ñˆ�Ø�}Š}˜YÑ'Ô'ð 	ØØð 	#ð 	#ˆCÝ”7×#Ò# CÑ(Ô(×.Ò.Ñ0Ô0ˆDÝŒw�~Š~˜cÑ"Ô"ð # t¨{Ð':Ð':Ø˜c�{Ð"Ð"Ð"Ð"Ð"øð	#ð ˆ4r   c                 ó¸  — |                       d¦  «        rt          | ¦  «        S t          j                             | ¦  «                             ¦   «         }|dk    st                               |¦  «        rC|d         } |dd …         }t          j                             | ¦  «                             ¦   «         }|t          v r|| fS t          ||¦  «        }|r|S d S )Nú-Úrosettar   r   )
Ú
startswithr   r   r   r   r   ÚQEMU_BIN_REGEXÚ	fullmatchr   r+   )ÚcmdÚargsr*   Úshells       r   Ú
_get_shellr5   W   sÒ   € Ø
‡~‚~�cÑÔð %Ý Ñ$Ô$Ð$ÝŒ7×Ò˜CÑ Ô ×&Ò&Ñ(Ô(€DØˆyÒÐ�N×4Ò4°TÑ:Ô:Ðð �1ŒgˆØ�A�B�BŒxˆÝŒw×Ò Ñ$Ô$×*Ò*Ñ,Ô,ˆØ�{ÐÐØ�cˆ{ÐÝ" 4¨Ñ.Ô.€EØð ØˆØˆ4r   c                 ó–   — t          | pt          j        ¦   «         ¦  «        } t          | |¦  «        D ]\  }}}t	          |Ž }|r|c S ŒdS )zAGet the shell that the supplied pid or os.getpid() is running in.N)Ústrr   Úgetpidr   r5   )r   r   r&   Ú_r4   s        r   Ú	get_shellr:   i   s^   € å
ˆcÐ •R”Y‘[”[Ñ
!Ô
!€CÝ0°°iÑ@Ô@ð ð ‰ˆ	�1�aÝ˜IÐ&ˆØð 	ØˆLˆLˆLð	àˆ4r   )r	   )Nr	   )r   ÚreÚ_corer   r   r   r   r   ÚcompileÚVERBOSEr0   r   r   r"   r+   r5   r:   © r   r   ú<module>r@      sì   ðØ 	€	€	€	Ø 	€	€	€	à 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø Ð Ð Ð Ð Ð Ð Ð ð �”ð	ð0 „Jñ3ô €ð:Pð Pð Pð Pð:ð :ð :ð €R„ZÐ)Ñ*Ô*¨W¨IÐ6ðÐ ð
ð ð ð(ð ð ð$ð ð ð ð ð r   