def __init__(self,
path=None,
arguments=None,
description=None,
workingdir=None,
iconpath=None,
iconidx=0):
self._base = pythoncom.CoCreateInstance(
shell.CLSID_ShellLink, None,
pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink
)
data = map(None,
['"%s"' % os.path.abspath(path), arguments, description,
os.path.abspath(workingdir), os.path.abspath(iconpath)],
("SetPath", "SetArguments", "SetDescription",
"SetWorkingDirectory") )
for value, function in data:
if value and function:
# call function on each non-null value
getattr(self, function)(value)
if iconpath:
self.SetIconLocation(iconpath, iconidx)
评论列表
文章目录