This branch adds some sanity checks for HWDB submission containing udev data (as sent by the HWDB client in Karmic), and it defines a new class UdevDevice, representing a device described by udev data. (The class is quite rudimentary at present.)
The idea of class UdevDevice is to "mangle" the raw data provided in a submission so that we cana populate the HWDB tables from this data. (See the base class BaseDevice and sibling class HALDevice for details.)
A new method SubmissionParser.checkUdevPciProperties() ensures that udev data for PCI devices have certain properties and that these properties have useful data, thus allowing class UdevDevice to make some assumptions about the data it is based on, for example, that the value of the property PCI_CLASS is an integer represented as a hexdecimal string.
SubmissionParser.checkConsistency() now calls checkConsistentUdevDeviceData(). The former method also assumed that the data for each submission contains a dictionary for data from HAL, which is no longer true, so some sanity checks specific for submissions with HAL data are now skipped for submissinos with udev data.
lib/canonical/launchpad/scripts/hwdbsubmissions.py
22: redefinition of unused 'etree' from line 20
lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py
11: redefinition of unused 'etree' from line 9
== Pylint notices ==
lib/canonical/launchpad/scripts/hwdbsubmissions.py
1160: [C0301] Line too long (79/78)
20: [F0401] Unable to import 'xml.etree.cElementTree' (No module named etree)
lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py
9: [F0401] Unable to import 'xml.etree.cElementTree' (No module named etree)
These etree-related complaints are not caused by the changes in this branch.
This branch adds some sanity checks for HWDB submission containing udev data (as sent by the HWDB client in Karmic), and it defines a new class UdevDevice, representing a device described by udev data. (The class is quite rudimentary at present.)
The idea of class UdevDevice is to "mangle" the raw data provided in a submission so that we cana populate the HWDB tables from this data. (See the base class BaseDevice and sibling class HALDevice for details.)
A new method SubmissionParse r.checkUdevPciP roperties( ) ensures that udev data for PCI devices have certain properties and that these properties have useful data, thus allowing class UdevDevice to make some assumptions about the data it is based on, for example, that the value of the property PCI_CLASS is an integer represented as a hexdecimal string.
SubmissionParse r.checkConsiste ncy() now calls checkConsistent UdevDeviceData( ). The former method also assumed that the data for each submission contains a dictionary for data from HAL, which is no longer true, so some sanity checks specific for submissions with HAL data are now skipped for submissinos with udev data.
tests:
./bin/test -t test_hwdb_ submission_ parser submission_ processing
./bin/test -t test_hwdb_
= 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 _parser. py /launchpad/ scripts/ tests/test_ hwdb_submission _processing. py
lib/canonical
lib/canonical
lib/canonical
== Pyflakes notices ==
lib/canonical/ launchpad/ scripts/ hwdbsubmissions .py
22: redefinition of unused 'etree' from line 20
lib/canonical/ launchpad/ scripts/ tests/test_ hwdb_submission _parser. py
11: redefinition of unused 'etree' from line 9
== Pylint notices ==
lib/canonical/ launchpad/ scripts/ hwdbsubmissions .py cElementTree' (No module named etree)
1160: [C0301] Line too long (79/78)
20: [F0401] Unable to import 'xml.etree.
lib/canonical/ launchpad/ scripts/ tests/test_ hwdb_submission _parser. py cElementTree' (No module named etree)
9: [F0401] Unable to import 'xml.etree.
These etree-related complaints are not caused by the changes in this branch.