o ¯bþã@s:dZddlZddlZddlmZdd„ZGdd„dƒZdS)z5 Creation of Windows shortcuts. Requires win32all. éN)ÚshellcCstƒ}| |¡|S)zg Open an existing shortcut for reading. @return: The shortcut object @rtype: Shortcut )ÚShortcutÚload)ÚfilenameÚsc©rú9/usr/lib/python3/dist-packages/twisted/python/shortcut.pyÚopens r c@s>eZdZdZ      d dd„Zdd„Zdd „Zd d „ZdS) rz A shortcut on Win32. NrcCs”t tjdtjtj¡|_|dur| tj   |¡¡|dur"|  |¡|dur+|  |¡|dur8|  tj   |¡¡|durH| tj   |¡|¡dSdS)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ÚiconidxrrrÚ__init__"s"ü  ÿzShortcut.__init__cCs |j tj¡ tj |¡¡dS)z1 Read a shortcut file from disk. N)rÚQueryInterfacer ÚIID_IPersistFileÚLoadrrr©rrrrrrEs ÿz Shortcut.loadcCs"|j tj¡ tj |¡d¡dS)z^ Write the shortcut to disk. The file should be named something.lnk. rN)rrr r ÚSaverrrr"rrrÚsaveMs ÿz Shortcut.savecCs t|j|ƒS)N)Úgetattrr)rÚnamerrrÚ __getattr__Ws zShortcut.__getattr__)NNNNNr)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr$r'rrrrrs ù# r)r+rr Úwin32com.shellrr rrrrrÚs