Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/utils/__pycache__/sysinfo.cpython-39.pyc
Ðазад
a o�h � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl mZmZ e ee e f d�dd�Ze ed�d d �Zed�dd �Zdd� Zdd� ZdS )zQ Utilities for getting information about IPython and the system it's running in. � N)�Path)�release)�_sysinfo�encoding)�pkg_path�returnc C sR t jrdt jfS tjd�d�tjtj| d�}|�� \}}|rNd|�� �d�fS dS )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 Zinstallationzgit 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 �procZrepo_commit�_� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/utils/sysinfo.py�pkg_commit_hash s �r c C s8 t | �\}}ttj| ||tjtjtjt�� tjt j d� S )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 ) Zipython_versionZipython_pathZ commit_sourceZcommit_hash�sys_versionZsys_executable�sys_platform�platform�os_nameZdefault_encoding)r �dictr �version�sys� executabler �os�namer �DEFAULT_ENCODING)r �srcZhshr r r �pkg_infoF s �r'