src/eric7/eric7_post_install.py

branch
eric7
changeset 11148
15e30f0c76a8
parent 11090
f5f5f5803935
equal deleted inserted replaced
11147:dee6e106b4d3 11148:15e30f0c76a8
64 @type str 64 @type str
65 @return value of requested registry variable 65 @return value of requested registry variable
66 @rtype Any 66 @rtype Any
67 """ 67 """
68 try: 68 try:
69 import winreg # __IGNORE_WARNING_I10__ 69 import winreg # __IGNORE_WARNING_I-10__
70 except ImportError: 70 except ImportError:
71 return None 71 return None
72 72
73 try: 73 try:
74 registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path, 0, winreg.KEY_READ) 74 registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path, 0, winreg.KEY_READ)
124 @param targetPath path the shortcut shall point to 124 @param targetPath path the shortcut shall point to
125 @type str 125 @type str
126 @param iconPath path of the icon file 126 @param iconPath path of the icon file
127 @type str 127 @type str
128 """ 128 """
129 from pywintypes import com_error # __IGNORE_WARNING_I102__ 129 from pywintypes import com_error # __IGNORE_WARNING_I-102__
130 from win32com.client import Dispatch # __IGNORE_WARNING_I102__ 130 from win32com.client import Dispatch # __IGNORE_WARNING_I-102__
131 131
132 with contextlib.suppress(com_error): 132 with contextlib.suppress(com_error):
133 shell = Dispatch("WScript.Shell") 133 shell = Dispatch("WScript.Shell")
134 shortcut = shell.CreateShortCut(linkPath) 134 shortcut = shell.CreateShortCut(linkPath)
135 shortcut.Targetpath = targetPath 135 shortcut.Targetpath = targetPath

eric ide

mercurial