Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
MSVSProject.cpython-313.pyc89 linesDownload Raw Back to __pycache__
1�

2��i���P�SrSSKJr "SS5r"SS5r"SS5rg	)3z$Visual Studio project reader/writer.�)�easy_xmlc�(�\rSrSrSrSSjrSrSrg)�Tool�zVisual Studio tool.Nc�@�U=(d 0UlXRS'g)z_Initializes the tool.4 5Args:6  name: Tool name.7  attrs: Dict of tool attributes; may be None.8�NameN��_attrs)�self�name�attrss   �`D:\code\apps\devtools\node24\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSProject.py�__init__�
Tool.__init__s���k�r���"���F��c��SUR/$)zQCreates an element for the tool.9 10Returns:11  A new xml.dom.Element for the tool.12rr	)rs r�_GetSpecification�Tool._GetSpecifications������$�$rr	�N)�__name__�13__module__�__qualname__�__firstlineno__�__doc__rr�__static_attributes__�rrrrs���#�%rrc�"�\rSrSrSrSSjrSrg)�Filter�"z1Visual Studio filter - that is, a virtual folder.Nc�B�Xl[U=(d /5Ulg)z|Initializes the folder.14 15Args:16  name: Filter (folder) name.17  contents: List of filenames and/or Filter objects contained.18N)r�list�contents)rrr"s   rr�Filter.__init__%s���	��X�^��,��
r)r"rr)rrrrrrrrrrrr"s19��;�-rrc�T�\rSrSrSrS
SjrSrSrS
SjrSr	S	r20S
S21jrSrSr
g)�Writer�3z!Visual Studio XML project writer.Nc���XlX lX0lX@lU(dS/nS/UlUH"nURRSSU0/5 M$ S/UlS/UlS/Ul0Ul	g)	aInitializes the project.22 23Args:24  project_path: Path to the project file.25  version: Format version to emit.26  name: Name of the project.27  guid: GUID to use for project, if not None.28  platforms: Array of string, the supported platforms.  If null, ['Win32']29�Win32�	Platforms�Platformr�	ToolFiles�Configurations�FilesN)30�project_path�versionr�guid�platform_section�append�tool_files_section�configurations_section�
files_section�31files_dict)rr.r/rr0�	platforms�platforms       rr�Writer.__init__6s���)�����	��	�� �	�I�"-�
���!�H��!�!�(�(�*�v�x�6H�)I�J�"�#.�-���'7�&8��#�%�Y�����rc�B�URRSSU0/5 g)zYAdds a tool file to the project.32 33Args:34  path: Relative path from project to tool file.35�ToolFile�RelativePathN)r3r2)r�paths  r�AddToolFile�Writer.AddToolFileTs"��	
���&�&�36�^�T�4J�'K�Lrc�4�U(d0nU(d/nUR5nX%S'X/nU(agUHan[U[5(a!URUR	55 M9UR[U5R	55 Mc U$)aReturns the specification for a configuration.37 38Args:39  config_type: Type of configuration node.40  config_name: Configuration name.41  attrs: Dict of configuration attributes; may be None.42  tools: List of tools (strings or Tool objects); may be None.43Returns:44r)�copy�45isinstancerr2r)r�config_type�config_namer
�tools�46node_attrs�
specification�ts        r�_GetSpecForConfiguration�Writer._GetSpecForConfiguration\s�����E���E��Z�Z�\�47�(�6��$�1�
�����a��&�&�!�(�(��)<�)<�)>�?�!�(�(��a��)B�)B�)D�E�	�48�rc�`�URSXU5nURRU5 g)z�Adds a configuration to the project.49 50Args:51  name: Configuration name.52  attrs: Dict of configuration attributes; may be None.53  tools: List of tools (strings or Tool objects); may be None.54�
ConfigurationN)rIr4r2)rrr
rE�specs     r�	AddConfig�Writer.AddConfigzs,���,�,�_�d�5�Q���#�#�*�*�4�0rc���UHin[U[5(a,SSUR0/nURXCR5 OSSU0/nX@R55U'UR
U5 Mk g)z�Adds files and/or filters to the parent node.56 57Args:58  parent: Destination node59  files: A list of Filter objects and/or relative paths to files.60 61Will call itself recursively, if the files list contains Filter objects.62rr�Filer<N)rBrr�_AddFilesToNoder"r6r2)r�parent�files�f�nodes     rrR�Writer._AddFilesToNode�sg���A��!�V�$�$� �6�1�6�6�"2�3���$�$�T�:�:�6���� 3�4��%)����"��M�M�$��rc�<�URURU5 g)a3Adds files to the project.63 64Args:65  files: A list of Filter objects and/or relative paths to files.66 67This makes a copy of the file/filter tree at the time of this call.  If you68later add files to a Filter object which was passed into a previous call69to AddFiles(), it will not be reflected in this project.70N)rRr5)rrTs  r�AddFiles�Writer.AddFiles�s��	
���T�/�/��7rc��URRU5nU(d[SU-5eURSX#U5nUR	U5 g)a<Adds a configuration to a file.71 72Args:73  path: Relative path to the file.74  config: Name of configuration to add.75  attrs: Dict of configuration attributes; may be None.76  tools: List of tools (strings or Tool objects); may be None.77 78Raises:79  ValueError: Relative path does not match any file added via AddFiles().80z(AddFileConfig: file "%s" not in project.�FileConfigurationN)r6�get�81ValueErrorrIr2)rr=�configr
rErSrMs       r�
AddFileConfig�Writer.AddFileConfig�sP�����$�$�T�*����G�$�N�O�O��,�,�-@�&�QV�W���
�
�d�rc�$�SSURR5URURURSS.URUR82URS/URS//n[R"XRSS9 g	)83zWrites the project file.�VisualStudioProjectz84Visual C++�	Win32Proj)�ProjectType�Versionr�ProjectGUID�
RootNamespace�Keyword�85References�GlobalszWindows-1252)�encodingN)r/�ProjectVersionrr0r1r3r4r5r�WriteXmlIfChangedr.)r�contents  r�WriteIfChanged�Writer.WriteIfChanged�s���
"�+��<�<�6�6�8��	�	�#�y�y�!%���&�

�
�!�!��#�#��'�'�
�N����
�K�86��"	�"�"�7�,=�,=��Wr)	r4r6r5r0rr1r.r3r/)NN)rrrrrrr>rIrNrRrYr`rprrrrr%r%3s/��+��<M��<	1� �$878��*Xrr%N)r�gyprrrr%rrr�<module>rss/��88+��89%�%�,-�-�"[X�[Xr
codekingpro/portable-devtools · Team Ai