/
usr
/
lib64
/
python3.9
/
site-packages
/
hgdemandimport
/
__pycache__
/
Upload File
HOME
a �+�b�+ � @ s� d Z ddlmZ ddlZddlZddlZddlmZ ej Z e Ze� Z dd� ZG dd � d e�Zd ejv Zddd �Ze� add� Zdd� Zdd� Zdd� Ze dd� �ZdS )aU demandimport - automatic demandloading of modules To enable this module, do: import demandimport; demandimport.enable() Imports of the following forms will be demand-loaded: import a, b.c import a.b as c from a import b,c # a will be loaded immediately These imports will not be delayed: from a import * b = __import__(a) � )�absolute_importN� )�tracingc O s� z| ||g|�R i |��W S t y� |s.� d| }|�dd�d }|�dd��dd�d }||krh� | ||g|�R i |�� Y S 0 d S )Nzhgext_%s�.r r �__name__� )�ImportError�split�get)� importfunc�name�globals�args�kwargsZ hgextnameZnamerootZcontextroot� r �D/usr/lib64/python3.9/site-packages/hgdemandimport/demandimportpy2.py�_hgextimport* s r c @ sh e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zedd� �Z edd� �ZdS )� _demandmodzxmodule demand-loader and proxy Specify 1 as 'level' argument at construction, to import module relatively. c C sV d|v r |� dd�\}}|g}n|}g }t�| d|||||t� f� t�| dd � d S )Nr r �_data�_module)r �object�__setattr__�set)�selfr r �locals�level�head�rest�afterr r r �__init__A s �z_demandmod.__init__c C s | j d �|� dS )z%add to the list of submodules to load� N)r �append�r r r r r �_extendM s z_demandmod._extendc C s | j d �|� dS )a� Record that the named module ``name`` imports this module. References to this proxy class having the name of this module will be replaced at module load time. We assume the symbol inside the importing module is identical to the "head" name of this module. We don't actually know if "as X" syntax is being used to change the symbol name because this information isn't exposed to __import__. � N)r �addr"