ó
    Ñ]jˆ  ã                   ó¢   • S r SSKrSSKrSSKrSSKrSSKrSSKJr  SSKJ	r	  SSK
JrJr  S\S\\\4   4S jrS\S\4S	 jrS\4S
 jrS\4S jrg)zQ
Utilities for getting information about IPython and the system it's running in.
é    N)ÚPath)Úrelease)Ú_sysinfoÚencodingÚpkg_pathÚreturnc                 óJ  • [         R                  (       a  S[         R                  4$ [        R                  " SR	                  S5      [        R
                  [        R
                  U S9nUR                  5       u  p#U(       a!  SUR                  5       R                  S5      4$ g)aâ  Get short form of commit hash given directory `pkg_path`

We get the commit hash from (in order of preference):

* IPython.utils._sysinfo.commit
* git output, if we are in a git repository

If these fail, we return a not-found placeholder tuple

Parameters
----------
pkg_path : str
    directory containing package
    only used for getting commit from active repo

Returns
-------
hash_from : str
    Where we got the hash from - description
hash_str : str
    short form of hash
Úinstallationzgit rev-parse --short HEADÚ )ÚstdoutÚstderrÚcwdÚ
repositoryÚascii)z(none found)z<not found>)	r   ÚcommitÚ
subprocessÚPopenÚsplitÚPIPEÚcommunicateÚstripÚdecode)r   ÚprocÚrepo_commitÚ_s       ÚR/home/mande/repo/quber/.venv/lib/python3.13/site-packages/IPython/utils/sysinfo.pyÚpkg_commit_hashr       s‚   € ô0 ‡‡ØœxŸ™Ð.Ð.ô ×ÒÐ8×>Ñ>¸sÓCÜ#-§?¡?Ü#-§?¡?Ø (ñ*€Dð ×%Ñ%Ó'�N€KÞØ˜[×.Ñ.Ó0×7Ñ7¸Ó@Ð@Ð@Ø(ó    c                 ó  • [        U 5      u  p[        [        R                  U UU[        R                  [        R
                  [        R                  [        R                  " 5       [        R                  [        R                  S9
$ )zËReturn dict describing the context of this package

Parameters
----------
pkg_path : str
    path containing __init__.py for package

Returns
-------
context : dict
    with named parameters of interest
)
Úipython_versionÚipython_pathÚcommit_sourceÚcommit_hashÚsys_versionÚsys_executableÚsys_platformÚplatformÚos_nameÚdefault_encoding)r   Údictr   ÚversionÚsysÚ
executabler'   ÚosÚnamer   ÚDEFAULT_ENCODING)r   ÚsrcÚhshs      r   Úpkg_infor3   F   s^   € ô ˜xÓ(�H€CÜÜŸ™ØØØÜ—K‘KÜ—~‘~Ü—\‘\Ü×"Ò"Ó$Ü—‘Ü!×2Ñ2ñ
ð 
r   c                  óz   • [        [        S5      R                  5       R                  n [	        [        U 5      5      $ )zBReturn useful information about IPython and the system, as a dict.z..)r   Ú__file__ÚresolveÚparentr3   Ústr)Úpaths    r   Úget_sys_infor:   a   s,   € ä”˜$Ó×'Ñ'Ó)×0Ñ0€DÜ”C˜“IÓÐr   c                  ó>   • [         R                  " [        5       5      $ )a9  Return useful information about IPython and the system, as a string.

Examples
--------
::

    In [2]: print(sys_info())
    {'commit_hash': '144fdae',      # random
     'commit_source': 'repository',
     'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython',
     'ipython_version': '0.11.dev',
     'os_name': 'posix',
     'platform': 'Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick',
     'sys_executable': '/usr/bin/python',
     'sys_platform': 'linux2',
     'sys_version': '2.6.6 (r266:84292, Sep 15 2010, 15:52:39) \n[GCC 4.4.5]'}
)ÚpprintÚpformatr:   © r   r   Úsys_infor?   f   s   € ô$ �>Š>œ,›.Ó)Ð)r   )Ú__doc__r.   r'   r<   r,   r   Úpathlibr   ÚIPython.corer   ÚIPython.utilsr   r   r8   Útupler   r*   r3   r:   r?   r>   r   r   Ú<module>rE      sk   ðñó 
Û Û Û 
Û å å  ß ,ð#)˜cð #) e¨C°¨H¡oô #)ðL
�sð 
˜tô 
ð6�dô ð
*�#õ *r   