§
    Ï"Kbó  ã                   ór   — 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dS )	z$Visual Studio project reader/writer.é    Nc                   ó    — e Zd ZdZdd„Zd„ ZdS )ÚToolzVisual Studio tool.Nc                 ó,   — |pi | _         || j         d<   dS )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„KÑÐÐó    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Ð Ð 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dS )ÚFilterz1Visual Studio filter - that is, a virtual folder.Nc                 ó@   — || _         t          |pg ¦  «        | _        dS )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„M€M€Mr   r   )r   r   r   r   r   r   r   r   r   r   "   s.   € € € € € Ø9Ð9ð)ð )ð )ð )ð )ð )r   r   c                   óH   — 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dS )ÚWriterz!Visual Studio XML project writer.Nc                 óô   — || _         || _        || _        || _        |sdg}dg| _        |D ] }| j                             dd|ig¦  «         Œ!dg| _        dg| _        dg| _        t          ¦   «         | _
        dS )	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ð EˆØ
Ô×"Ò" J°¸Ð0BÐ#CÑDÔDÐDÐDØ*˜m€DÔØ#3Ð"4€DÔØ!˜€DÔõ ‘f”f€D„O€O€Or   c                 óB   — | j                              dd|ig¦  «         dS )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ÑHÔHÐHÐHÐHr   c                 ó@  — |si }|sg }|                      ¦   «         }||d<   ||g}|rv|D ]s}t          |t          ¦  «        r(|                     |                     ¦   «         ¦  «         Œ?|                     t          |¦  «                             ¦   «         ¦  «         Œt|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Ô4Ñ
5Ô
5Ð
5Ð
5à
×
Ò
t A™wœw×8Ò8Ñ:Ô:Ñ
;Ô
;Ð
;Ð
;ØÐr   c                 ój   — |                       d|||¦  «        }| j                             |¦  «         dS )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ÔM€DØÔ×&Ò& tÑ,Ô,Ð,Ð,Ð,r   c                 óÒ   — |D ]c}t          |t          ¦  «        r'dd|j        ig}|                      ||j        ¦  «         ndd|ig}|| j        |<   |                     |¦  «         ŒddS )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†   s‹   € ð ð ð ˆÝ	A•vÑ	Ô	ð "Ø˜6 1¤6Ð*Ð+ˆØ×Ò˜T 1¤:Ñ.Ô.Ð.Ð.à˜¨Ð+Ð,ˆØ!ˆŒ˜ÑØ‡m‚mDÑÔÐÐðð r   c                 ó<   — |                       | j        |¦  «         dS )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Ñ3Ô3Ð3Ð3Ð3r   c                 ó¼   — | j                              |¦  «        }|st          d|z  ¦  «        ‚|                      d|||¦  «        }|                     |¦  «         dS )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¦   so   € ð Œ_× Ò  Ñ&Ô&€FØð JÝÐAÀDÑHÑIÔIÐIð ×(Ò(Ð)<¸fÀeØ).ñ0ô 0€Dà
‡M‚M$ÑÔÐÐÐr   c                 óØ   — dd| j                              ¦   «         | j        | j        | j        ddœ| j        | j        | j        dg| j        dgg}t          j	        || j
        d¬¦  «         d	S )
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×/Ò/Ñ1Ô1Ø”Øœ	Øœ)Øð	
ð 	
ð 	ÔØÔØÔ#Ø	ˆØÔØ	ˆð€Gõ  Ô˜w¨Ô(9Ø(6ð8ñ 8ô 8ð 8ð 8ð 8r   )NN)r   r   r   r   r   r5   r?   rC   rF   rL   rR   rb   r   r   r   r   r   3   s¤   € € € € € Ø)Ð)ðð ð ð ð<Ið Ið Iðð ð ð>	-ð 	-ð 	-ð 	-ðð ð ð$
4ð 
4ð 
4ðð ð ð ð,8ð 8ð 8ð 8ð 8r   r   )	r   Ú
gyp.commonÚgypÚgyp.easy_xmlr_   Úobjectr   r   r   r   r   r   ú<module>rg      s½   ðð
 +Ð *à Ð Ð Ð Ø Ð Ð Ð Ð Ð ð
!ð !ð !ð !ð !ˆ6ñ !ô !ð !ð*)ð )ð )ð )ð )ˆVñ )ô )ð )ð"]8ð ]8ð ]8ð ]8ð ]8ˆVñ ]8ô ]8ð ]8ð ]8ð ]8r   