HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //usr/lib/python3.6/site-packages/gyp/__pycache__/MSVSProject.cpython-36.pyc
3

e�AU��@sJdZddlZddljZGdd�de�ZGdd�de�ZGdd�de�ZdS)	z$Visual Studio project reader/writer.�Nc@s"eZdZdZddd�Zdd�ZdS)�ToolzVisual Studio tool.NcCs|pi|_||jd<dS)zoInitializes the tool.

    Args:
      name: Tool name.
      attrs: Dict of tool attributes; may be None.
    �NameN)�_attrs)�self�name�attrs�r�!/usr/lib/python3.6/MSVSProject.py�__init__s
z
Tool.__init__cCs
d|jgS)z]Creates an element for the tool.

    Returns:
      A new xml.dom.Element for the tool.
    r)r)rrrr	�_GetSpecificationszTool._GetSpecification)N)�__name__�
__module__�__qualname__�__doc__r
rrrrr	r
s

rc@seZdZdZddd�ZdS)�Filterz1Visual Studio filter - that is, a virtual folder.NcCs||_t|pg�|_dS)z�Initializes the folder.

    Args:
      name: Filter (folder) name.
      contents: List of filenames and/or Filter objects contained.
    N)r�list�contents)rrrrrr	r
%szFilter.__init__)N)rr
rrr
rrrr	r"src@sVeZdZdZddd�Zdd�Zdd�Zdd	d
�Zdd�Zd
d�Z	ddd�Z
dd�ZdS)�Writerz!Visual Studio XML project writer.NcCsp||_||_||_||_|s"dg}dg|_x |D]}|jjdd|ig�q0Wdg|_dg|_dg|_t	�|_
dS)	aInitializes the project.

    Args:
      project_path: Path to the project file.
      version: Format version to emit.
      name: Name of the project.
      guid: GUID to use for project, if not None.
      platforms: Array of string, the supported platforms.  If null, ['Win32']
    ZWin32Z	PlatformsZPlatformrZ	ToolFilesZConfigurationsZFilesN)�project_path�versionr�guid�platform_section�append�tool_files_section�configurations_section�
files_section�dict�
files_dict)rrrrrZ	platforms�platformrrr	r
6s

zWriter.__init__cCs|jjdd|ig�dS)zeAdds a tool file to the project.

    Args:
      path: Relative path from project to tool file.
    ZToolFile�RelativePathN)rr)r�pathrrr	�AddToolFileTszWriter.AddToolFilecCsj|si}|sg}|j�}||d<||g}|rfx8|D]0}t|t�rP|j|j��q2|jt|�j��q2W|S)a Returns the specification for a configuration.

    Args:
      config_type: Type of configuration node.
      config_name: Configuration name.
      attrs: Dict of configuration attributes; may be None.
      tools: List of tools (strings or Tool objects); may be None.
    Returns:
    r)�copy�
isinstancerrr)rZconfig_typeZconfig_namer�toolsZ
node_attrsZ
specification�trrr	�_GetSpecForConfiguration\s

zWriter._GetSpecForConfigurationcCs |jd|||�}|jj|�dS)z�Adds a configuration to the project.

    Args:
      name: Configuration name.
      attrs: Dict of configuration attributes; may be None.
      tools: List of tools (strings or Tool objects); may be None.
    Z
ConfigurationN)r&rr)rrrr$�specrrr	�	AddConfig{szWriter.AddConfigcCsZxT|D]L}t|t�r2dd|jig}|j||j�ndd|ig}||j|<|j|�qWdS)z�Adds files and/or filters to the parent node.

    Args:
      parent: Destination node
      files: A list of Filter objects and/or relative paths to files.

    Will call itself recursively, if the files list contains Filter objects.
    rrZFilerN)r#rr�_AddFilesToNoderrr)r�parent�files�fZnoderrr	r)�s	


zWriter._AddFilesToNodecCs|j|j|�dS)aKAdds files to the project.

    Args:
      files: A list of Filter objects and/or relative paths to files.

    This makes a copy of the file/filter tree at the time of this call.  If you
    later add files to a Filter object which was passed into a previous call
    to AddFiles(), it will not be reflected in this project.
    N)r)r)rr+rrr	�AddFiles�s
zWriter.AddFilescCs:|jj|�}|std|��|jd|||�}|j|�dS)a\Adds a configuration to a file.

    Args:
      path: Relative path to the file.
      config: Name of configuration to add.
      attrs: Dict of configuration attributes; may be None.
      tools: List of tools (strings or Tool objects); may be None.

    Raises:
      ValueError: Relative path does not match any file added via AddFiles().
    z(AddFileConfig: file "%s" not in project.ZFileConfigurationN)r�get�
ValueErrorr&r)rr �configrr$r*r'rrr	�
AddFileConfig�s

zWriter.AddFileConfigcCsPdd|jj�|j|j|jdd�|j|j|jdg|jdgg}tj	||j
dd�d	S)
zWrites the project file.ZVisualStudioProjectz
Visual C++Z	Win32Proj)ZProjectTypeZVersionrZProjectGUIDZ
RootNamespaceZKeywordZ
ReferencesZGlobalszWindows-1252)�encodingN)rZProjectVersionrrrrrr�easy_xmlZWriteXmlIfChangedr)rZcontentrrr	�WriteIfChanged�s
zWriter.WriteIfChanged)NN)NN)NN)rr
rrr
r!r&r(r)r-r1r4rrrr	r3s


r)	rZ
gyp.commonZgypZgyp.easy_xmlr3�objectrrrrrrr	�<module>s