src/eric7/eric7_post_install.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
65 @type str 65 @type str
66 @return value of requested registry variable 66 @return value of requested registry variable
67 @rtype any 67 @rtype any
68 """ 68 """
69 try: 69 try:
70 import winreg 70 import winreg # __IGNORE_WARNING_I10__
71 except ImportError: 71 except ImportError:
72 return None 72 return None
73 73
74 try: 74 try:
75 registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path, 0, winreg.KEY_READ) 75 registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path, 0, winreg.KEY_READ)
120 @param targetPath path the shortcut shall point to 120 @param targetPath path the shortcut shall point to
121 @type str 121 @type str
122 @param iconPath path of the icon file 122 @param iconPath path of the icon file
123 @type str 123 @type str
124 """ 124 """
125 from pywintypes import com_error 125 from pywintypes import com_error # __IGNORE_WARNING_I102__
126 from win32com.client import Dispatch 126 from win32com.client import Dispatch # __IGNORE_WARNING_I102__
127 127
128 with contextlib.suppress(com_error): 128 with contextlib.suppress(com_error):
129 shell = Dispatch("WScript.Shell") 129 shell = Dispatch("WScript.Shell")
130 shortcut = shell.CreateShortCut(linkPath) 130 shortcut = shell.CreateShortCut(linkPath)
131 shortcut.Targetpath = targetPath 131 shortcut.Targetpath = targetPath

eric ide

mercurial