HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1780863/root/usr/lib/python3/dist-packages/gyp/__pycache__/
Upload File :
Current File : //proc/1780863/root/usr/lib/python3/dist-packages/gyp/__pycache__/common.cpython-311.pyc
�

�"Kb�O���ddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
Gd�de��ZGd�de
��Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zed&d���Zed'd���Zd�Zd�Zejd��Zejd��Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$ifd�Z%d'd�Z&Gd �d!e
j'��Z(Gd"�d#e
��Z)d$�Z*d%�Z+dS)(�)�with_statementN)�collections_abcc��eZdZd�Zd�ZdS)�memoizec�"�||_i|_dS�N)�func�cache)�selfr	s  �,/usr/lib/python3/dist-packages/gyp/common.py�__init__zmemoize.__init__s���D�I��D�J�J�J�c�j�	|j|S#t$r|j|�}||j|<|cYSwxYwr)r
�KeyErrorr	)r�args�results   r�__call__zmemoize.__call__sR���
�Z��
��������t�y�$��f��d�j���
�m�m�m����s�� 2�2N)�__name__�
__module__�__qualname__r
r�rrrrs2�������������rrc��eZdZdZdS)�GypErrorz�Error class representing an error, which is to be presented
  to the user.  The main entry point will catch and display this.
  N)rrr�__doc__rrrrr s���������$rrc��|js
|f|_dSt|j��dkr(t|jd��dz|zf|_dSt|jd��dz|zf|jdd�z|_dS)z2Append a message to the given exception's message.�r� N)r�len�str)�e�msgs  r�ExceptionAppendr"'s���	
��8��V�A�F�F�F�
�1�6�{�{�a����!�&��)�n�n�s�"�S�(�
*�A�F�F�F��!�&��)�n�n�s�"�S�(�
*�Q�V�A�B�B�Z�
7�A�F�F�Frc� ���fd�|D��S)zc
  Given a list of qualified targets, return the qualified targets for the
  specified |target|.
  c�F��g|]}t|��d�k�|��S)r��ParseQualifiedTarget)�.0�t�targets  �r�
<listcomp>z(FindQualifiedTargets.<locals>.<listcomp>6s1���	L�	L�	L��';�A�'>�'>�q�'A�V�'K�'K�!�'K�'K�'Krr)r)�qualified_lists` r�FindQualifiedTargetsr,1s ���

M�	L�	L�	L�^�	L�	L�	L�Lrc���|�dd��}t|��dkr|\}}nd}|�dd��}t|��dkr|\}}nd}|||gS)N�:r��#)�rsplitr)r)�target_split�
build_file�toolsets    rr&r&9s�����s�A�&�&�,�����!���'��Z����J����s�A�&�&�,�����!���$��V�W�W��G�
�f�g�	&�&rc�Z�t|��\}}}|r�|r�tj�tj�tj�|��|����}tj�|��st|d��}n|}|r|}|||gS)N�.)r&�os�path�normpath�join�dirname�isabs�RelativePath)r3r)r4�parsed_build_file�parsed_toolsets     r�
ResolveTargetr@Ls���1E�V�0L�0L�-��f�n��%��
%��7�#�#�B�G�L�L������1L�1L�1B�%D�%D�E�E�j��W�]�]�:�
&�
&�3�!�*�c�2�2�
��$�j����G�
�f�g�	&�&rc�,�t|��dS�Nrr%)�fully_qualified_targets r�	BuildFilerDns��	�4�	5�	5�a�	8�8rc�T�|D]$}|tjvrtj|cS�%|S)zpLook up a key in the environment, with fallback to secondary keys
  and finally falling back to a default value.)r7�environ)�var_list�default�vars   r�GetEnvironFallbackrJss<�����c�
�b�j���
�Z��_�����	�.rc�*�|dz|z}|r|dz|z}|S)Nr.r0r)r3r)r4�fully_qualifieds    r�QualifiedTargetrM|s0����$�v�-�/��6�%��+�g�5�O�	�rTc�b�|r tj�|��}ntj�|��}tj�|��}tjdkrrtj�|��d���tj�|��d���kr|S|�tjj	��}|�tjj	��}ttj�||g����}tjjgt|��|z
z||d�z}t|��dkrdStjj
|�S)N�win32r�)r7r8�realpath�abspath�sys�platform�
splitdrive�lower�split�sepr�commonprefix�pardirr:)r8�relative_to�follow_path_symlink�
path_split�relative_to_split�
prefix_len�relative_splits       rr=r=�sb���!�
�7���D�!�!�D�D�
�7�?�?�4� � �D��� � ��-�-�+�	�\�W���
����4� � ��#�)�)�+�+�
����;�'�'��*�0�0�2�2�	3�	3�
�k��z�z�"�'�+�&�&�*�!�'�'����4�4���2�7�'�'��5F�(G�H�H�I�I�*��G�N�#�s�+<�'=�'=�
�'J�K��j�k�k�*�+�.�	����A���
�2�
���~�	&�&rc�r�|s|S|�dn|}t|tj�||����S)aGiven a path like foo/bar that is relative to toplevel_dir, return
  the inverse relative path back to the toplevel_dir.

  E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path)))
  should always produce the empty string, unless the path contains symlinks.
  Nr6)r=r7r8r:)r8�toplevel_dirs  r�InvertRelativePathrc�s?��
���K�$�,���,�,�	�l�B�G�L�L��t�$D�$D�	E�	E�Erc�d�tj�|��r|St||��Sr)r7r8r<r=)r8r[s  r�FixIfRelativePathre�s-���W�]�]�4�����K�	�d�K�	(�	(�(rc��tj�|��}tj�tj�||����Sr)r7r8r;r9r:)r8r[�rel_dirs   r�UnrelativePathrh�s=��
�G�O�O�K�(�(�'�	��	�	�"�'�,�,�w��5�5�	6�	6�6rz[	
 #$%&'()*;<=>?[{|}~]|^$z(["\\`])c���t|t��st|��}t�|��rd}nd}|t	jtd|��z|z}|S)a�Encodes |argument| suitably for consumption by POSIX shells.

  argument may be quoted and escaped as necessary to ensure that POSIX shells
  treat the returned value as a literal representing the argument passed to
  this function.  Parameter (variable) expansions beginning with $ are allowed
  to remain intact without escaping the $, to allow the argument to contain
  references to variables to be expanded by the shell.
  �"rPz\\\1)�
isinstancer�_quote�search�re�sub�_escape)�argument�quote�encodeds   r�EncodePOSIXShellArgumentrtsc��
�H�c�	"�	"���8�}�}�H��]�]�8�����E�E��E��B�F�7�G�X�6�6�6��>�'�	�.rc�~�g}|D]$}|�t|�����%d�|��S)z�Encodes |list| suitably for consumption by POSIX shells.

  Returns EncodePOSIXShellArgument for each item in list, and joins them
  together using the space character as an argument separator.
  r)�appendrtr:)�list�encoded_argumentsrqs   r�EncodePOSIXShellListrysN�����A�A�h����5�h�?�?�@�@�@�@�	���#�	$�	$�$rc���t��}t|��}|r�|���}||vr�|�|��||}|�t|�dg������|�t|�dg������|��t|t|��z
��S)z2Returns the recursive list of target dependencies.�dependencies�dependencies_original)�set�pop�add�update�getrw)�target_dicts�rootsr{�pending�r�specs      r�DeepDependencyTargetsr�)s������,���J�J�'��?����
�
�A��L�������Q������?�D��N�N�3�t�x�x���3�3�4�4�5�5�5��N�N�3�t�x�x� 7��<�<�=�=�>�>�>�	�?�
�l�S��Z�Z�'�	(�	(�(rc� ���fd�|D��S)zHFrom a target_list, returns the subset from the specified build_file.
  c�:��g|]}t|���k�|��Sr)rD)r'�pr3s  �rr*z$BuildFileTargets.<locals>.<listcomp>?s)���	?�	?�	?��I�a�L�L�J�$>�$>�!�$>�$>�$>rr)�target_listr3s `r�BuildFileTargetsr�<s ���
@�	?�	?�	?�[�	?�	?�	?�?rc�L�t||��}t||��}||zS)zNReturns all targets (direct and dependencies) for the specified build_file.
  )r�r�)r�r�r3�	bftargets�
deptargetss     r�
AllTargetsr�Bs-���{�J�7�7�)�$�\�9�=�=�*�	�Z�	�rc�B��G�fd�dt��}|��S)z�Write to a file only if the new contents differ.

  Arguments:
    filename: name of the file to potentially write to.
  Returns:
    A file like object which will write to temporary file and only overwrite
    the target if it differs (on close).
  c�.��eZdZdZ�fd�Zd�Z�fd�ZdS)�WriteOnDiff.<locals>.Writerz?Wrapper around file which only covers the target if it differs.c�^��tjdtj����ddztj����d���\}|_	tj|d��|_dS#t$rtj	|j���wxYw)Nz.tmprz.gyp.r)�suffix�prefix�dir�w)
�tempfile�mkstempr7r8rW�tmp_path�fdopen�tmp_file�	Exception�unlink)r�tmp_fd�filenames  �rr
z$WriteOnDiff.<locals>.Writer.__init__Vs����&�.������x�(�(��+�g�5��g�m�m�H�%�%�a�(�*�*�*��f�d�m���	�&�#�.�.��
�
�
��
����
�	�$�-� � � �
����s�+B�%B,c�,�t|j|��Sr)�getattrr�)r�attrnames  r�__getattr__z'WriteOnDiff.<locals>.Writer.__getattr__cs��
�T�]�H�
-�
-�-rc���	|j���d}	tj|j�d��}n-#t
$r }|jtjkr�Yd}~nd}~wwxYw|rtj	|j��dStj
d��}tj
|��tj|jd|z��tj
dkr3tj����rtj���tj|j���dS#t$$rtj	|j���wxYw)NF�?i�rO)r��close�filecmp�cmpr��OSError�errno�ENOENTr7r��umask�chmodrSrTr8�exists�remove�renamer�)r�samer r�r�s    �rr�z!WriteOnDiff.<locals>.Writer.closegsU���&��
��������	���T�]�H�e�<�<�$�$���	�	�	�
�W���
$�
$��%�
$�
$�
$�
$�����	�����	-�
�)�D�M�
"�
"�
"�
"�
"��(�4�.�.�%�
�(�5�/�/�/�
�(�4�=�%�5�&�.�
1�
1�
1�
�\�W�
$�
$������)A�)A�
$�
�I�h����
�)�D�M�8�
,�
,�
,�
,�
,��
����
�	�$�-� � � �
����s8�D*�;�D*�
A%�A �D*� A%�%D*�B#D*�*%EN)rrrrr
r�r�)r�s�r�Writerr�Ts\�������I�I������.�.�.�'�'�'�'�'�'�'rr�)�object)r�r�s` r�WriteOnDiffr�JsE���:�:�:�:�:�:�:�v�:�:�:�x
����/rc��	tjtj�|����dS#t$rYdSwxYw)z*Make sure the directory for |path| exists.N)r7�makedirsr8r;r�)r8s r�EnsureDirExistsr��sM��	��K������%�%�&�&�&�&�&��	�	�	�	��D�D�	���s�15�
A�Ac�8�dddd�}d|vr|dStj|vr|tjStj�d��rdStj�d��rdStj�d��rdStj�d	��rd	Stj�d
��rd
Stj�d��rdStj�d��rdSd
S)zFReturns |params.flavor| if it's set, the system's default flavor else.�win�mac)�cygwinrO�darwin�flavor�sunos�solaris�freebsd�openbsd�netbsd�aix�zos�os390�linux)rSrT�
startswith)�params�flavorss  r�	GetFlavorr��s���
��
�
�'������(����\�W����3�<� � ��\���W�%�%���9��\���Y�'�'���9��\���Y�'�'���9��\���X�&�&���8��\���U�#�#���5��\���U�#�#���5��\���W�%�%���5�	�rc	��ddddd��|d��}|sdStj�tj�tj�t����d|z��}t|��5}|���}ddd��n#1swxYwYd}|�dd��}|dkr
|r|d	|zz
}tj�|d
|z��}	t|	d��5}
|
�	d�|d
|g|dd�z����ddd��n#1swxYwYtj
|	d��dS)zRFinds (flock|mac|win)_tool.gyp in the gyp directory and copies it
  to |out_path|.�flockr�r�)r�r�r�r�Nz
%s_tool.pyz!# Generated by gyp. Do not edit.
�mac_toolchain_dirz,import os;
os.environ['DEVELOPER_DIR']='%s'
zgyp-%s-toolr�rPrri�)r�r7r8r:r;rR�__file__�open�	readlines�writer�)r��out_path�generator_flagsr��source_path�source_file�source�headerr��	tool_path�	tool_files           r�CopyToolr��s����
�
�	��
	��F�D���	�
��
�F������g�o�o�b�g�o�o�h�/�/�0�0�,��2G�I�I�+��K���%�K�
�
"�
"�
$�
$�F�%�%�%�%�%�%�%�%�%�%�%����%�%�%�%�0�&�&�*�*�+>��E�E���u�_�_�*�_�
�>�
���F��g�l�l�8�]�V�%;�<�<�)��I�s���3�y�
�O�O�
������F�#�f�Q�R�R�j�0�1�1�3�3�3�3�3�3�3�3�3�3�3�3�3�3����3�3�3�3�
�(�9�e�����s$�B2�2B6�9B6�<E � E$�'E$c�v�|�d�}i}g}|D],}||��}||vr�d||<|�|���-|S)Nc��|Srr)�xs r�<lambda>zuniquer.<locals>.<lambda>�s��!�rr)rv)�seq�idfun�seenr�item�markers      r�uniquerr��sb���}����
�D�
�F�������t�����T�>�>�8���V���
�
�d������Mrc�T�eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dd
�Z
d�Zd�Zd
�Z
dS)�
OrderedSetNc�H�gx|_}|d||gz
}i|_|�||z}dSdSr)�end�map)r�iterabler�s   rr
zOrderedSet.__init__�sB����D�H�s��D�#�s���C��D�H���
�h��d�d�d��rc�*�t|j��Sr)rr��rs r�__len__zOrderedSet.__len__�s���t�x�=�=�rc��||jvSr)r�)r�keys  r�__contains__zOrderedSet.__contains__�s���$�(�?�rc�h�||jvr(|j}|d}|||gx|d<x|d<|j|<dSdS)Nrr/)r�r�)rr�r��currs    rrzOrderedSet.addsO��
�$�(����H�c�
��V�d�*-�t�S�)9�9�d�1�g�9��A����#�����rc�l�||jvr*|j�|��\}}}||d<||d<dSdS)Nr/r)r�r~)rr��	prev_item�	next_items    r�discardzOrderedSet.discardsD��
�d�h���"&�(�,�,�s�"3�"3��c�9�i��i��l��i��l�l�l��rc#�`K�|j}|d}||ur|dV�|d}||u�dSdS)Nr/r�r��rr�r�s   r�__iter__zOrderedSet.__iter__�H����
�(�C��q�6�D�
�c�/�/���G�m�m�m�
�!�W�d��c�/�/�/�/�/�/rc#�`K�|j}|d}||ur|dV�|d}||u�dSdS)Nrrr�r�s   r�__reversed__zOrderedSet.__reversed__r�rTc��|std���|r|jddn|jdd}|�|��|S)Nzset is emptyrrr/)rr�r�)r�lastr�s   rr~zOrderedSet.popsQ���%��^�$�$�$� �
4�$�(�1�+�a�.�.�d�h�q�k�!�n�C��L�L������Jrc�b�|s|jj�d�S|jj�dt|���d�S)Nz()�(�))�	__class__rrwr�s r�__repr__zOrderedSet.__repr__"s>���1��~�.�.�.�
0�0��~�.�.�.��T�
�
�
�
�;�;rc���t|t��r@t|��t|��kot|��t|��kSt	|��t	|��kSr)rkr�rrwr})r�others  r�__eq__zOrderedSet.__eq__'sY���%��$�$�C�
��Y�Y�#�e�*�*�
$�
B��d���t�E�{�{�)B�B��t�9�9��E�
�
�"�"rc�B�|D]}||vr|�|���dSr)r)rr��is   rr�zOrderedSet.update-s4��
����	
�$������������rr�T)rrrr
r�r�rr�r�r�r~rr	r�rrrr�r��s�����������������:�:�:��������������<�<�<�
#�#�#�����rr�c��eZdZdZd�Zd�ZdS)�
CycleErrorz9An exception raised when an unexpected cycle is detected.c��||_dSr)�nodes)rrs  rr
zCycleError.__init__5s
���D�J�J�Jrc�0�dt|j��zS)NzCycleError: cycle involving: )rrr�s r�__str__zCycleError.__str__7s��*�S���_�_�<�<rN)rrrrr
rrrrrr3s8������A�A����=�=�=�=�=rrc�������t����t���t���g������fd��t|��D]
}�|����S)a�Topologically sort based on a user provided edge definition.

  Args:
    graph: A list of node names.
    get_edges: A function mapping from node name to a hashable collection
               of node names which this node has outgoing edges to.
  Returns:
    A list containing all of the node in graph in topological order.
    It is assumed that calling get_edges once for each node and caching is
    cheaper than repeatedly calling get_edges.
  Raises:
    CycleError in the event of a cycle.
  Example:
    graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'}
    def GetEdges(node):
      return re.findall(r'\$\(([^))]\)', graph[node])
    print(TopologicallySorted(graph.keys(), GetEdges))
    ==>
    ['a', 'c', b']
  c���|�vrt����|�vrdS��|����|���|��D]
}�|�����|����d|��dSrB)rrr��insert)�node�neighbor�Visit�	get_edges�
ordered_nodes�visited�visitings  �����rrz"TopologicallySorted.<locals>.VisitTs�����x����x� � � ��w����f��K�K������L�L������I�d�O�O�����e�H�o�o�o�o��O�O�D��������D�!�!�!�!�!r)rr}�sorted)�graphrrrrrrs ` @@@@r�TopologicallySortedr;s��������*�i� � �)��E�E�'�
�U�U�(��-�
"�
"�
"�
"�
"�
"�
"�
"�
"��U�m�m���d�	�E�$�K�K�K�K�	�rc��tj�d��p�tj�d��p�tj�d��p{tj�d��p\tj�d��p=tj�d��ptj�d��S)N�GYP_CROSSCOMPILE�AR_host�CC_host�CXX_host�	AR_target�	CC_target�
CXX_target)r7rFr�rrr�CrossCompileRequestedr(cs���
�*�.�.�+�
,�
,�'�
�*�.�.��
#�
#�'�
�*�.�.��
#�
#�'�
�*�.�.��
$�
$�'�
�*�.�.��
%�
%�	'�

�*�.�.��
%�
%�'�
�*�.�.��
&�
&�
(rrr),�
__future__rr�r��os.pathr7rnr�rS�	six.movesrr�rr�rr"r,r&r@rDrJrMr=rcrerh�compilerlrprtryr�r�r�r�r�r�r�r��
MutableSetr�rrr(rrr�<module>r.s���
&�%�%�%�%�%�������������	�	�	�	�����
�
�
�
�%�%�%�%�%�%�

�
�
�
�
�f�
�
�
������y����8�8�8�M�M�M�'�'�'�&'�'�'�D9�9�9�
������	�('�('�('�	��('�V	�
F�
F�
F�	��
F�)�)�)�7�7�7�D
���3�	4�	4��4�"�*�[�
!�
!�����.
%�
%�
%�)�)�)�&@�@�@� � � �F�F�F�R	�	�	����<02�"�"�"�"�V
�
�
�
�>�>�>�>�>��+�>�>�>�B=�=�=�=�=��=�=�=�&�&�&�P	(�	(�	(�	(�	(r