Merge lp:~adeuring/launchpad/hwdb-build-udev-device-list into lp:launchpad
Proposed by
Abel Deuring
Status: | Merged |
---|---|
Approved by: | Brad Crittenden |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~adeuring/launchpad/hwdb-build-udev-device-list |
Merge into: | lp:launchpad |
Diff against target: |
248 lines 2 files modified
lib/canonical/launchpad/scripts/hwdbsubmissions.py (+51/-0) lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py (+155/-1) |
To merge this branch: | bzr merge lp:~adeuring/launchpad/hwdb-build-udev-device-list |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | code | Approve | |
Review via email: mp+13644@code.launchpad.net |
To post a comment you must log in.
This branch adds a new method SubmissionParse r.buildUdevDevi ceList( ) for the HWDB submission processing script.
Hardware devices mentioned in a given submission are represented by instances of class UdevDevice. The new method SubmissionParse r.buildUdevDevi ceList( ) gets the data found in a submission in a dictionary parsed_data and uses it it to create UdevDevice instances. parsed_data contains, among other things, the elements parsed_ data['hardware' ]['udev' ], parsed_ data['hardware' ]['sysfs- attributes' ] and parsed_ data['hardware' ]['dmi' ].
The udev data is our main source for imformations about devices; in some cases we need additional data from sysfs-attributes and from dmi. parsed_ data['hardware' ]['dmi' ] contains data relevant for the root node of a device; parsed_ data['hardware' ]['sysfs- attributes' ] is a dictionary containing more data for some devices mentioned in the udev data.
The udev data describes a hierachy of devices (like "A USB controller and an Ethernet interface are connected to the main system; the USB controller is connected to a USB hub, which in turn is connected to a USB printer") by the path names of the udev nodes. Since we store the device hierachy of the devices in a given submission in the HWDB, UdevDevice has an attribute "children", which should contain, well, the children of a given node.
I wanted to use the method assertIsNone in one or two of the tests; in order to do that, I had to change the import of class TestCase from unittest to lp.testing.
tests: ./bin/test --test= test_hwdb_ submission_ processing
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: /launchpad/ scripts/ hwdbsubmissions .py /launchpad/ scripts/ tests/test_ hwdb_submission _processing. py
lib/canonical
lib/canonical
== Pyflakes notices ==
lib/canonical/ launchpad/ scripts/ hwdbsubmissions .py
22: redefinition of unused 'etree' from line 20
== Pylint notices ==
lib/canonical/ launchpad/ scripts/ hwdbsubmissions .py cElementTree' (No module named etree)
20: [F0401] Unable to import 'xml.etree.
This complaint is not related to my changes.