ó
    æ“–gS  ã                   óP   • S r SSKJr   " S S5      r " S S5      r " S S5      rg)	z$Visual Studio project reader/writer.é    Nc                   ó(   • \ rS rSrSrSS jrS rSrg)ÚToolé   zVisual Studio tool.Nc                 ó@   • U=(       d    0 U l         XR                   S'   g)z_Initializes the tool.

Args:
  name: Tool name.
  attrs: Dict of tool attributes; may be None.
ÚNameN©Ú_attrs)ÚselfÚnameÚattrss      Ú1/usr/lib/python3/dist-packages/gyp/MSVSProject.pyÚ__init__ÚTool.__init__   s   € ð —k˜rˆŒØ"�‰�FÒó    c                 ó   • SU R                   /$ )zQCreates an element for the tool.

Returns:
  A new xml.dom.Element for the tool.
r   r   )r
   s    r   Ú_GetSpecificationÚTool._GetSpecification   s   € ð ˜Ÿ™Ð$Ð$r   r   ©N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__© r   r   r   r      s   † Ùô#õ%r   r   c                   ó"   • \ rS rSrSrSS jrSrg)ÚFilteré"   z1Visual Studio filter - that is, a virtual folder.Nc                 óB   • Xl         [        U=(       d    / 5      U l        g)z|Initializes the folder.

Args:
  name: Filter (folder) name.
  contents: List of filenames and/or Filter objects contained.
N)r   ÚlistÚcontents)r
   r   r!   s      r   r   ÚFilter.__init__%   s   € ð Œ	Ü˜XŸ^¨Ó,ˆ�r   )r!   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   "   s
   † Ù;÷-r   r   c                   óT   • \ rS rSrSrSS jrS rS rSS jrS r	S	 r
SS
 jrS rSrg)ÚWriteré3   z!Visual Studio XML project writer.Nc                 óæ   • Xl         X l        X0l        X@l        U(       d  S/nS/U l        U H"  nU R                  R                  SSU0/5        M$     S/U l        S/U l        S/U l        0 U l	        g)	a  Initializes 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']
ÚWin32Ú	PlatformsÚPlatformr   Ú	ToolFilesÚConfigurationsÚFilesN)
Úproject_pathÚversionr   ÚguidÚplatform_sectionÚappendÚtool_files_sectionÚconfigurations_sectionÚfiles_sectionÚ
files_dict)r
   r-   r.   r   r/   Ú	platformsÚplatforms          r   r   ÚWriter.__init__6   s�   € ð )ÔØŒØŒ	ØŒ	ö Ø ˜	ˆIð "- ˆÔÛ!ˆHØ×!Ñ!×(Ñ(¨*°v¸xÐ6HÐ)IÖJñ "à#. -ˆÔØ'7Ð&8ˆÔ#Ø%˜YˆÔð ˆ�r   c                 óB   • U R                   R                  SSU0/5        g)zYAdds a tool file to the project.

Args:
  path: Relative path from project to tool file.
ÚToolFileÚRelativePathN)r2   r1   )r
   Úpaths     r   ÚAddToolFileÚWriter.AddToolFileT   s"   € ð 	×Ñ×&Ñ&¨
°^ÀTÐ4JÐ'KÕLr   c                 ó4  • U(       d  0 nU(       d  / nUR                  5       nX%S'   X/nU(       ag  U Ha  n[        U[        5      (       a!  UR                  UR	                  5       5        M9  UR                  [        U5      R	                  5       5        Mc     U$ )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Ú
isinstancer   r1   r   )r
   Úconfig_typeÚconfig_namer   ÚtoolsÚ
node_attrsÚspecificationÚts           r   Ú_GetSpecForConfigurationÚWriter._GetSpecForConfiguration\   s‡   € ö ØˆEÞØˆEð —Z‘Z“\ˆ
Ø(�6ÑØ$Ð1ˆö Û�Ü˜a¤×&Ñ&Ø!×(Ñ(¨×)<Ñ)<Ó)>Ö?à!×(Ñ(¬¨a«×)BÑ)BÓ)DÖEñ	 ð
 Ðr   c                 ó`   • U R                  SXU5      nU R                  R                  U5        g)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.
ÚConfigurationN)rH   r3   r1   )r
   r   r   rD   Úspecs        r   Ú	AddConfigÚWriter.AddConfigz   s,   € ð ×,Ñ,¨_¸dÈ5ÓQˆØ×#Ñ#×*Ñ*¨4Õ0r   c                 óâ   • U Hi  n[        U[        5      (       a,  SSUR                  0/nU R                  XCR                  5        OSSU0/nX@R
                  U'   UR                  U5        Mk     g)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.
r   r   ÚFiler;   N)rA   r   r   Ú_AddFilesToNoder!   r5   r1   )r
   ÚparentÚfilesÚfÚnodes        r   rQ   ÚWriter._AddFilesToNode…   sg   € ó ˆAÜ˜!œV×$Ñ$Ø  6¨1¯6©6Ð"2Ð3�Ø×$Ñ$ T¯:©:Õ6à °Ð 3Ð4�Ø%)—‘ Ñ"Ø�M‰M˜$Öò r   c                 ó<   • U R                  U R                  U5        g)a3  Adds 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)rQ   r4   )r
   rS   s     r   ÚAddFilesÚWriter.AddFiles—   s   € ð 	×Ñ˜T×/Ñ/°Õ7r   c                 ó¬   • U R                   R                  U5      nU(       d  [        SU-  5      eU R                  SX#U5      nUR	                  U5        g)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.ÚFileConfigurationN)r5   ÚgetÚ
ValueErrorrH   r1   )r
   r<   Úconfigr   rD   rR   rL   s          r   ÚAddFileConfigÚWriter.AddFileConfig¥   sP   € ð —‘×$Ñ$ TÓ*ˆÞÜÐGÈ$ÑNÓOÐOð ×,Ñ,Ð-@À&ÐQVÓWˆØ�‰�dÕr   c                 ó$  • SSU R                   R                  5       U R                  U R                  U R                  SS.U R                  U R
                  U R                  S/U R                  S//n[        R                  " XR                  SS9  g	)
zWrites the project file.ÚVisualStudioProjectz
Visual C++Ú	Win32Proj)ÚProjectTypeÚVersionr   ÚProjectGUIDÚRootNamespaceÚKeywordÚ
ReferencesÚGlobalszWindows-1252)ÚencodingN)r.   ÚProjectVersionr   r/   r0   r2   r3   r4   Úeasy_xmlÚWriteXmlIfChangedr-   )r
   Úcontents     r   ÚWriteIfChangedÚWriter.WriteIfChangedº   s†   € ð "à+ØŸ<™<×6Ñ6Ó8ØŸ	™	Ø#Ÿy™yØ!%§¡Ø&ñð ×!Ñ!Ø×#Ñ#Ø×'Ñ'ØˆNØ×ÑØˆKð
ˆô" 	×"Ò" 7×,=Ñ,=ÈÓWr   )	r3   r5   r4   r/   r   r0   r-   r2   r.   )NN)r   r   r   r   r   r   r=   rH   rM   rQ   rX   r_   rp   r   r   r   r   r$   r$   3   s/   † Ù+ôò<Mòô<	1ò ò$
8ôõ*Xr   r$   )r   Úgyp.easy_xmlrm   r   r   r$   r   r   r   Ú<module>rs      s/   ðñ
 +å ÷
%ñ %÷,-ñ -÷"[Xò [Xr   