in pci_lib/pci_lib.py [0:0]
def get_path(self):
"""
Get a list of PCIDevices including this device and all devices up to
the root port it is connected to.
"""
path = []
current = self
while current:
path.append(current)
current = current.parent
return path