Ë
    Ï"Kbó  ã                   ó^   — d Z ddlZddlmZ  G d„ de«      Z G d„ de«      Z G d„ de«      Zy)	z$Visual Studio project reader/writer.é    Nc                   ó   — e Zd ZdZdd„Zd„ Zy)ÚToolzVisual Studio tool.Nc                 ó8   — |xs i | _         || j                   d<   y)zoInitializes 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__zTool.__init__   s   € ð ’+˜2€D„KØ€D‡KKÒó    c                 ó   — d| j                   gS )z]Creates an element for the tool.

    Returns:
      A new xml.dom.Element for the tool.
    r   r   )r	   s    r   Ú_GetSpecificationzTool._GetSpecification   s   € ð D—K‘KÐ Ð r   ©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   © r   r   r   r      s   „ Ùóó!r   r   c                   ó   — e Zd ZdZdd„Zy)ÚFilterz1Visual Studio filter - that is, a virtual folder.Nc                 ó:   — || _         t        |xs g «      | _        y)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   zFilter.__init__%   s   € ð €D„IÜ˜š RÓ(€D…Mr   r   )r   r   r   r   r   r   r   r   r   r   "   s
   „ Ù9ô)r   r   c                   óF   — e Zd ZdZdd„Zd„ Zd„ Zdd„Zd„ Zd„ Z	dd	„Z
d
„ Zy)ÚWriterz!Visual Studio XML project writer.Nc                 óð   — || _         || _        || _        || _        |sdg}dg| _        |D ]!  }| j                  j                  dd|ig«       Œ# dg| _        dg| _        dg| _        t        «       | _
        y)	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ÚdictÚ
files_dict)r	   r%   r&   r
   r'   Ú	platformsÚplatforms          r   r   zWriter.__init__6   s’   € ð %€DÔØ€D„LØ€D„IØ€D„Iñ Ø)€ið )˜M€DÔØò EˆØ
×Ñ×"Ñ" J°¸Ð0BÐ#CÕDðEà*˜m€DÔØ#3Ð"4€DÔØ!˜€DÔô “f€D…Or   c                 óB   — | j                   j                  dd|ig«       y)zeAdds a tool file to the project.

    Args:
      path: Relative path from project to tool file.
    ÚToolFileÚRelativePathN)r*   r)   )r	   Úpaths     r   ÚAddToolFilezWriter.AddToolFileT   s"   € ð 	×Ñ×"Ñ" J°ÀÐ0FÐ#GÕHr   c                 ó
  — |si }|sg }|j                  «       }||d<   ||g}|r_|D ]Z  }t        |t        «      r |j                  |j	                  «       «       Œ3|j                  t        |«      j	                  «       «       Œ\ |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Ú
isinstancer   r)   r   )r	   Úconfig_typeÚconfig_namer   ÚtoolsÚ
node_attrsÚspecificationÚts           r   Ú_GetSpecForConfigurationzWriter._GetSpecForConfiguration\   s   € ñ Ø€eÙØ€eð —‘“€JØ$€JˆvÑØ  *Ð-€Mñ Øò <ˆ!ÜaœÔØ
×
Ñ
˜q×2Ñ2Ó4Õ
5à
×
Ñ
œt A›w×8Ñ8Ó:Õ
;ð	<ð
 Ðr   c                 ób   — | j                  d|||«      }| j                  j                  |«       y)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)r?   r+   r)   )r	   r
   r   r;   Úspecs        r   Ú	AddConfigzWriter.AddConfig{   s.   € ð ×(Ñ(¨¸$ÀÀuÓM€DØ×Ñ×&Ñ& tÕ,r   c                 óØ   — |D ]e  }t        |t        «      r-dd|j                  ig}| j                  ||j                  «       ndd|ig}|| j
                  |<   |j                  |«       Œg y)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   ÚFiler3   N)r8   r   r
   Ú_AddFilesToNoder   r.   r)   )r	   ÚparentÚfilesÚfÚnodes        r   rF   zWriter._AddFilesToNode†   sm   € ð ò ˆÜ	A”vÔ	Ø˜6 1§6¡6Ð*Ð+ˆØ×Ñ˜T 1§:¡:Õ.à˜¨Ð+Ð,ˆØ!ˆ‰˜ÑØ‡mmDÕñr   c                 ó<   — | j                  | j                  |«       y)aK  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)rF   r,   )r	   rH   s     r   ÚAddFileszWriter.AddFiles˜   s   € ð 	×Ñ˜×+Ñ+¨UÕ3r   c                 ó¤   — | j                   j                  |«      }|st        d|z  «      ‚| j                  d|||«      }|j	                  |«       y)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)r.   ÚgetÚ
ValueErrorr?   r)   )r	   r4   Úconfigr   r;   rG   rB   s          r   ÚAddFileConfigzWriter.AddFileConfig¦   sT   € ð _‰_× Ñ  Ó&€FÙÜÐAÀDÑHÓIÐIð ×(Ñ(Ð)<¸fÀeØ).ó0€Dà
‡MM$Õr   c                 ó*  — dd| j                   j                  «       | j                  | j                  | j                  ddœ| j                  | j
                  | j                  dg| j                  dgg}t        j                  || j                  d¬«       y	)
zWrites the project file.ÚVisualStudioProjectz
Visual C++Ú	Win32Proj)ÚProjectTypeÚVersionr   ÚProjectGUIDÚRootNamespaceÚKeywordÚ
ReferencesÚGlobalszWindows-1252)ÚencodingN)r&   ÚProjectVersionr
   r'   r(   r*   r+   r,   Úeasy_xmlÚWriteXmlIfChangedr%   )r	   Úcontents     r   ÚWriteIfChangedzWriter.WriteIfChanged¼   s‹   € ð 	Ø$Ø—L‘L×/Ñ/Ó1Ø—‘ØŸ	™	ØŸ)™)Øñ	
ð 	×ÑØ×ÑØ×#Ñ#Ø	ˆØ×ÑØ	ˆð€Gô  ×Ñ˜w¨×(9Ñ(9Ø(6ö8r   )NN)r   r   r   r   r   r5   r?   rC   rF   rL   rR   rb   r   r   r   r   r   3   s.   „ Ù)óò<Iòó>	-òò$
4óó,8r   r   )	r   Ú
gyp.commonÚgypÚgyp.easy_xmlr_   Úobjectr   r   r   r   r   r   ú<module>rg      s6   ðñ
 +ã Ý ô
!ˆ6ô !ô*)ˆVô )ô"]8ˆVõ ]8r   