
    \d                     F    d Z ddlZddlZddlmZ d Z G d d          ZdS )z5
Creation of  Windows shortcuts.

Requires win32all.
    N)shellc                 L    t                      }|                    |            |S )zg
    Open an existing shortcut for reading.

    @return: The shortcut object
    @rtype: Shortcut
    )Shortcutload)filenamescs     7lib/python3.11/site-packages/twisted/python/shortcut.pyopenr
      s$     
BGGHI    c                   8    e Zd ZdZ	 	 	 	 	 	 ddZd Zd Zd ZdS )	r   z
    A shortcut on Win32.
    Nr   c                    t          j        t          j        dt           j        t          j                  | _        |2|                     t          j	        
                    |                     ||                     |           ||                     |           |2|                     t          j	        
                    |                     |5|                     t          j	        
                    |          |           dS dS )a  
        @param path: Location of the target
        @param arguments: If path points to an executable, optional arguments
                      to pass
        @param description: Human-readable description of target
        @param workingdir: Directory from which target is launched
        @param iconpath: Filename that contains an icon for the shortcut
        @param iconidx: If iconpath is set, optional index of the icon desired
        N)	pythoncomCoCreateInstancer   CLSID_ShellLinkCLSCTX_INPROC_SERVERIID_IShellLink_baseSetPathospathabspathSetArgumentsSetDescriptionSetWorkingDirectorySetIconLocation)selfr   	argumentsdescription
workingdiriconpathiconidxs          r	   __init__zShortcut.__init__"   s    $ /!* 	
 

 LL../// i(((",,,!$$RW__Z%@%@AAA  !:!:GDDDDD  r   c                     | j                             t          j                                      t
          j                            |                     dS )z1
        Read a shortcut file from disk.
        N)r   QueryInterfacer   IID_IPersistFileLoadr   r   r   r   r   s     r	   r   zShortcut.loadE   sJ     	
!!)"<==BBGOOH%%	
 	
 	
 	
 	
r   c                     | j                             t          j                                      t
          j                            |          d           dS )z^
        Write the shortcut to disk.

        The file should be named something.lnk.
        r   N)r   r$   r   r%   Saver   r   r   r'   s     r	   savezShortcut.saveM   sL     	
!!)"<==BBGOOH%%q	
 	
 	
 	
 	
r   c                 ,    t          | j        |          S )N)getattrr   )r   names     r	   __getattr__zShortcut.__getattr__W   s    tz4(((r   )NNNNNr   )__name__
__module____qualname____doc__r"   r   r*   r.    r   r	   r   r      sx          !E !E !E !EF
 
 

 
 
) ) ) ) )r   r   )r2   r   r   win32com.shellr   r
   r   r3   r   r	   <module>r5      sy   
  
			                	 	 	;) ;) ;) ;) ;) ;) ;) ;) ;) ;)r   