def references (self, wmi_class=""):
"""Return a list of associations involving this object, optionally
limited by the result class (the name of the association class).
NB Associations are treated specially; although WMI only returns
the string corresponding to the instance of each associated object,
this module will automatically convert that to the object itself::
c = wmi.WMI ()
sp = c.Win32_SerialPort ()[0]
for i in sp.references ():
print i
for i in sp.references (wmi_class="Win32_SerialPortSetting"):
print i
"""
#
# FIXME: Allow an actual class to be passed in, using
# its .Path_.RelPath property to determine the string
#
try:
return [_wmi_object (i) for i in self.ole_object.References_ (strResultClass=wmi_class)]
except pywintypes.com_error:
handle_com_error ()
#
# class _wmi_event
#
评论列表
文章目录