]>
git.ipfire.org Git - oddments/fireinfo.git/blob - fireinfo/device.py
6 def __init__(self
, path
):
9 with
open(os
.path
.join(path
, "uevent")) as f
:
10 for line
in f
.readlines():
11 key
, val
= line
.split("=")
12 self
._uevent
[key
]=val
.rstrip().lower()
16 return self
._uevent
.get("DRIVER", None)
19 class PCIDevice(Device
):
24 return self
._uevent
['PCI_ID'].split(":")[1]
28 return self
._uevent
['PCI_ID'].split(":")[0]
31 def deviceclass(self
):
32 return self
._uevent
['PCI_CLASS']
35 class USBDevice(Device
):
46 return self
.pad(self
._uevent
['PRODUCT'].split("/")[0])
50 return self
.pad(self
._uevent
['PRODUCT'].split("/")[1])
53 def deviceclass(self
):
54 return self
._uevent
.get("INTERFACE", None)