from . import device_matcher import re __all__ = ["DeviceMatcherUdev"] class DeviceMatcherUdev(device_matcher.DeviceMatcher): def match(self, regex, device): """ Match a device against the udev regex in tuning profiles. device is a pyudev.Device object """ properties = '' try: items = device.properties.items() except AttributeError: items = device.items() for key, val in list(items): properties += key + '=' + val + '\n' return re.search(regex, properties, re.MULTILINE) is not None
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.__init__.pyo.40009 | File | 253 B | 0644 |
|
.device_matcher.pyo.40009 | File | 2.11 KB | 0644 |
|
.device_matcher_udev.pyo.40009 | File | 1.06 KB | 0644 |
|
.inventory.pyo.40009 | File | 4.76 KB | 0644 |
|
__init__.py | File | 90 B | 0644 |
|
__init__.pyc | File | 253 B | 0644 |
|
__init__.pyo | File | 253 B | 0644 |
|
device_matcher.py | File | 1.54 KB | 0644 |
|
device_matcher.pyc | File | 2.11 KB | 0644 |
|
device_matcher.pyo | File | 2.11 KB | 0644 |
|
device_matcher_udev.py | File | 521 B | 0644 |
|
device_matcher_udev.pyc | File | 1.06 KB | 0644 |
|
device_matcher_udev.pyo | File | 1.06 KB | 0644 |
|
inventory.py | File | 3.59 KB | 0644 |
|
inventory.pyc | File | 4.76 KB | 0644 |
|
inventory.pyo | File | 4.76 KB | 0644 |
|