From 968242c68749c8bc2037b61a8c98e09c564c058a Mon Sep 17 00:00:00 2001 From: bill-auger Date: Jun 25 2022 15:52:08 +0000 Subject: whitespace --- diff --git a/hclient/devices.py b/hclient/devices.py index a8c1f9b..c315f65 100644 --- a/hclient/devices.py +++ b/hclient/devices.py @@ -73,6 +73,7 @@ class Device(object): post["description"] = self._description.replace("\n", "\r\n") post["driver"] = self._driver post.update(self._type.post_data(self)) + return post def createOtherNamesEntry(self): @@ -99,6 +100,7 @@ class Device(object): can_distros = set(distro.strip() for distro in self._distributions) can_distros.discard("") can_distros = sorted(can_distros) + return " , ".join(can_distros) def addDistribution(self,distroName): @@ -368,6 +370,7 @@ def get_types(): types = [] for subclass in DeviceType.__subclasses__(): types.append(subclass.type_name) + return types diff --git a/hclient/devicetypes.py b/hclient/devicetypes.py index 9007dd9..6b136ee 100644 --- a/hclient/devicetypes.py +++ b/hclient/devicetypes.py @@ -29,20 +29,19 @@ from hclient.l10n import _ DEFAULT_INTERFACES = (_("not specified"), _("USB"), _("PCI"), _("PCI-E"), - _("mini-PCI"), _("mini-PCI-E"), _("ExpressCard"), - _("PC-Card")) + _("mini-PCI"), _("mini-PCI-E"), _("ExpressCard"), + _("PC-Card")) DEFAULT_INTERFACES_POST = ("not-specified", "USB", "PCI", "PCI-E", "mini-PCI", - "mini-PCI-E", "ExpressCard", "PC-Card") + "mini-PCI-E", "ExpressCard", "PC-Card") MOST_INTERFACES = (_("not specified"), _("USB"), _("PCI"), _("PCI-E"), - _("mini-PCI"), _("mini-PCI-E"), _("ExpressCard"), _("PC-Card"), - _("FireWire"), _("Parallel"), _("Serial")) + _("mini-PCI"), _("mini-PCI-E"), _("ExpressCard"), _("PC-Card"), + _("FireWire"), _("Parallel"), _("Serial")) MOST_INTERFACES_POST = ("not-specified", "USB", "PCI", "PCI-E", "mini-PCI", - "mini-PCI-E", "ExpressCard", "PC-Card", "Firewire", - "Parallel", "Serial") + "mini-PCI-E", "ExpressCard", "PC-Card", "Firewire", + "Parallel", "Serial") class DeviceType(object): - """Base class for device type objects.""" #: Tuple of options for the "how it works" field. @@ -79,6 +78,7 @@ class DeviceType(object): #: Icon name. icon = "unknown.png" + def __init__(self): """Error, since this class shouldn't be instantiated.""" raise TypeError("DeviceType instantiated") @@ -89,26 +89,24 @@ class DeviceType(object): this type.""" data = {} if cls.how_it_works_post_name is not None: - data[cls.how_it_works_post_name] \ - = cls.how_it_works_post[device.how_it_works] + data[cls.how_it_works_post_name] = cls.how_it_works_post[device.how_it_works] if cls.subtypes_post: data["subtype"] = cls.subtypes_post[device._subtype] if cls.tracks_users_post: - data["it_tracks_users"] \ - = cls.tracks_users_post[device.tracks_users] + data["it_tracks_users"] = cls.tracks_users_post[device.tracks_users] + return data class VideoCard(DeviceType): - """Video card.""" interfaces = (_("not specified"), _("PCI"), _("AGP"), _("PCI-E"), _("ISA"), - _("MCA"), _("VLB")) + _("MCA"), _("VLB")) interfaces_post = ("not-specified", "PCI", "AGP", "PCI-E", "ISA", "MCA", - "VLB") + "VLB") how_it_works = (_("works with 3D"), _("works without 3D"), - _("does not work")) + _("does not work")) how_it_works_post = ("works_with_3D", "works_without_3D", "does_not_work") how_it_works_post_name = "video_card_works" default_how_it_works = 2 @@ -119,7 +117,6 @@ class VideoCard(DeviceType): class Wifi(DeviceType): - """Wi-fi card.""" interfaces = DEFAULT_INTERFACES @@ -132,13 +129,12 @@ class Wifi(DeviceType): class SoundCard(DeviceType): - """Sound card.""" interfaces = (_("not specified"), _("PCI"), _("ISA"), _("USB"), - _("FireWire"), _("Parallel"), _("PCI-E"), _("PCMCIA")) + _("FireWire"), _("Parallel"), _("PCI-E"), _("PCMCIA")) interfaces_post = ("not-specified", "PCI", "ISA", "USB", "Firewire", - "Parallel", "PCI-E", "PCMCIA") + "Parallel", "PCI-E", "PCMCIA") how_it_works_post_name = "sound_card_works" classes = (0x0403,) type_name = "soundcard" @@ -147,13 +143,12 @@ class SoundCard(DeviceType): class Printer(DeviceType): - """Printer.""" interfaces = (_("not specified"), _("USB"), _("Serial"), _("Parallel"), - _("FireWire"), _("SCSI"), _("Ethernet")) + _("FireWire"), _("SCSI"), _("Ethernet")) interfaces_post = ("not-specified", "USB", "Serial", "Parallel", "Firewire", - "SCSI", "Ethernet") + "SCSI", "Ethernet") how_it_works = (_("A-Full"), _("B-Partial"), _("C-None")) how_it_works_post = ("A-Full", "B-Partial", "C-None") how_it_works_post_name = "compatibility" @@ -169,13 +164,12 @@ class Printer(DeviceType): class Scanner(DeviceType): - """Scanner.""" interfaces = (_("not specified"), _("USB"), _("Serial"), _("Parallel"), - _("FireWire"), _("SCSI"), _("Ethernet")) + _("FireWire"), _("SCSI"), _("Ethernet")) interfaces_post = ("not-specified", "USB", "Serial", "Parallel", "Firewire", - "SCSI", "Ethernet") + "SCSI", "Ethernet") how_it_works = (_("A-Full"), _("B-Partial"), _("C-None")) how_it_works_post = ("A-Full", "B-Partial", "C-None") how_it_works_post_name = "compatibility" @@ -187,7 +181,6 @@ class Scanner(DeviceType): class ThreeGCard(DeviceType): - """3G Card.""" interfaces = DEFAULT_INTERFACES @@ -200,13 +193,12 @@ class ThreeGCard(DeviceType): class Webcam(DeviceType): - """Web cam.""" interfaces = (_("not specified"), _("USB"), _("FireWire"), _("Parallel"), - _("Wifi"), _("Serial")) + _("Wifi"), _("Serial")) interfaces_post = ("not-specified", "USB", "Firewire", "Parallel", "Wifi", - "Serial") + "Serial") how_it_works_post_name = "webcam_works" classes = (0x0e0100, 0xff0100) type_name = "webcam" @@ -215,7 +207,6 @@ class Webcam(DeviceType): class Bluetooth(DeviceType): - """Bluetooth.""" interfaces = DEFAULT_INTERFACES @@ -228,7 +219,6 @@ class Bluetooth(DeviceType): class AcquisitionCard(DeviceType): - """Acquisition card.""" interfaces = MOST_INTERFACES @@ -241,7 +231,6 @@ class AcquisitionCard(DeviceType): class FingerprintReader(DeviceType): - """Fingerprint reader.""" interfaces = MOST_INTERFACES @@ -254,7 +243,6 @@ class FingerprintReader(DeviceType): class EthernetCard(DeviceType): - """Ethernet card.""" interfaces = MOST_INTERFACES @@ -267,7 +255,6 @@ class EthernetCard(DeviceType): class SDCardReader(DeviceType): - """SD card reader.""" interfaces = MOST_INTERFACES diff --git a/hclient/hlibrary.py b/hclient/hlibrary.py index 6551948..d25191f 100644 --- a/hclient/hlibrary.py +++ b/hclient/hlibrary.py @@ -319,6 +319,7 @@ class Client(object): if not result: self.errors.append("unable to connect to server") return False + # Get data of devices on the server into a dictionary. xml_devices = get_devices_from_xml(content) # Check local devices if they are on the server. @@ -330,7 +331,7 @@ class Client(object): try: device = xml_devices[key] except KeyError: - continue # device not found on the server + continue # device not found on the server interface = device.getElementsByTagName("interface")[0].childNodes[0].data device_type = device.getElementsByTagName("type")[0].childNodes[0].data @@ -391,6 +392,7 @@ class Client(object): dev[0].setYear(year) dev[2] = "update" dev[3] = device_id + return True def submit(self,deviceCode = None): diff --git a/hclient/l10n.py b/hclient/l10n.py index 3f321a8..a7b5c68 100644 --- a/hclient/l10n.py +++ b/hclient/l10n.py @@ -19,7 +19,6 @@ import gettext - import pkg_resources diff --git a/hclient/machine.py b/hclient/machine.py index 6a3ae8f..74e52b3 100644 --- a/hclient/machine.py +++ b/hclient/machine.py @@ -42,7 +42,6 @@ DISTRO_CODENAMES = \ class FileOpener(object): - """ Open and list files. Different implementations of this class would be used to test the distro detection code. @@ -147,6 +146,7 @@ def user_distribution(opener=FileOpener): for release in opener.glob("/etc/*-release"): if release == "/etc/os-release": continue + with opener.open(release) as release_file: for line in release_file: if line.find("CODENAME") != -1 \ @@ -323,6 +323,7 @@ def createDevices(pci_devices=None, usb_devices=None): dev_type = get_device_type_for_class(int(classcode, 16)) if not dev_type: continue + dev = Device(dev_type) dev.setBus("USB") dev.interface = dev_type.interfaces.index("USB") diff --git a/tests_hclient/__init__.py b/tests_hclient/__init__.py index 0a350c5..ac13406 100644 --- a/tests_hclient/__init__.py +++ b/tests_hclient/__init__.py @@ -1,6 +1,5 @@ # Trivial file, not copyrighted. - """ Unit tests for h-client. """ diff --git a/tests_hclient/devices.py b/tests_hclient/devices.py index 91d06c2..6e0bec3 100644 --- a/tests_hclient/devices.py +++ b/tests_hclient/devices.py @@ -25,7 +25,6 @@ import unittest class FindSubclassesTestCase(unittest.TestCase): - """Tests for functions searching subclasses of `hclient.devices.Device`.""" def test_class_none(self): @@ -37,7 +36,7 @@ class FindSubclassesTestCase(unittest.TestCase): """Test getting device objects for an known USB device class""" from hclient import devices, devicetypes self.assertEqual(devices.get_device_type_for_class(0xffffff), - devicetypes.Unknown) + devicetypes.Unknown) def test_type_none(self): """Test getting device objects for an unknown device type""" @@ -48,7 +47,7 @@ class FindSubclassesTestCase(unittest.TestCase): """Test getting device objects for an known device type""" from hclient import devices, devicetypes self.assertEqual(devices.get_device_type_for_type("soundcard"), - devicetypes.SoundCard) + devicetypes.SoundCard) def test_types(self): """Test that all type names are listed""" @@ -75,8 +74,7 @@ class FindSubclassesTestCase(unittest.TestCase): def test_get_class_for_type_known(self): """Test getting PCI class for a known type""" from hclient import devices - self.assertEqual(0x0400, - devices.get_class_for_type("acquisition-card")) + self.assertEqual(0x0400, devices.get_class_for_type("acquisition-card")) def test_get_class_for_type_unknown(self): """Test getting PCI class for an unknown type""" @@ -93,30 +91,28 @@ def _make_devices(): class DevicesTestCase(unittest.TestCase): - """Tests for methods of `Device` and subclasses.""" def test_othernames_has(self): """Test that other names can be made""" device = _make_devices()["p_10de:054c"][0] - self.assertEqual("1043:82b3 ASUSTeK Computer Inc. Device", - device.createOtherNamesEntry()) + other_name = '1043:82b3 ASUSTeK Computer Inc. Device' + self.assertEqual(other_name , device.createOtherNamesEntry()) def test_othernames_hasnt(self): """Tests that other names are not made if empty""" device = _make_devices()["p_10de:01df"][0] - self.assertEqual("", - device.createOtherNamesEntry()) + self.assertEqual('', device.createOtherNamesEntry()) class DataTestCase(unittest.TestCase): - """Tests for serialization of `Device`.""" def prepare_device(self): """Return a device for tests.""" from hclient.devices import Device from hclient.devicetypes import Wifi + # From http://www.h-node.org/wifi/view/en/8/Atheros-Communications-Inc--AR922X-Wireless-Network-Adapter/8/1 device = Device(Wifi) device.setModel("Atheros Communications Inc. AR922X Wireless Network Adapter") @@ -138,15 +134,10 @@ class DataTestCase(unittest.TestCase): device.setSubProductId(0x2091) device.setDriver("ath9k") device.setDescription("""[p]This is an Atheros AR9223 chipset, which uses the officially supported free ath9k Linux driver.[/p] - [p]The [a]http://www.tp-link.com/en/products/prodetail.aspx?id=389|TP-LINK TL-WN851N[/a] is a PCI card.[/p] - [p]The [a]http://www.tp-link.com/en/products/prodetail.aspx?id=717|TP-LINK TL-WN861N[/a] is a Mini-PCI card.[/p] - [p]The [a]http://www.dlink.com/products/?pid=531|D-Link DWA-552 Xtreme N Desktop Adapter[/a] is a PCI card.[/p] - [p]This chipset has been tested with IEEE 802.11g and 802.11n networks, unsecured and secured (WPA2-PSK).[/p] - [code]$ lspci -nnkd 168c:0029 06:02.0 Network controller [0280]: Atheros Communications Inc. AR922X Wireless Network Adapter [168c:0029] (rev 01) Subsystem: Atheros Communications Inc. Device [168c:2091] diff --git a/tests_hclient/hsource.py b/tests_hclient/hsource.py index 1ef7035..e262e90 100644 --- a/tests_hclient/hsource.py +++ b/tests_hclient/hsource.py @@ -264,7 +264,7 @@ _WITH_NOKEY = """ [code]trisquel@trisquel:~$ uname -a Linux trisquel 2.6.35-28-generic #50trisquel2-Ubuntu SMP Tue May 3 02:42:36 UTC 2011 x86_64 GNU/Linux -trisquel@trisquel:~$ lspci -vvnnd 10ee:0300 +trisquel@trisquel:~$ lspci -vvnnd 10ee:0300 04:08.0 ATM network controller [0203]: Xilinx Corporation Device [10ee:0300] Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- diff --git a/tests_hclient/machine.py b/tests_hclient/machine.py index 5144df0..ea24f00 100644 --- a/tests_hclient/machine.py +++ b/tests_hclient/machine.py @@ -26,7 +26,6 @@ import unittest class KernelVersionTestCase(unittest.TestCase): - """Tests for obtaining kernel version.""" def test_single_line(self): @@ -62,7 +61,6 @@ for line in _PARABOLA_OS_RELEASE.split('\n'): class _ParabolaOpener(object): - """Get Parabola identification files.""" @staticmethod @@ -97,7 +95,6 @@ DISTRIB_DESCRIPTION="Parabola GNU/Linux-libre" class _TaranisOpener(object): - """Get Trisquel Taranis identification files.""" @staticmethod @@ -124,7 +121,6 @@ DISTRIB_DESCRIPTION="Trisquel 4.1 LTS" class _QuantalOpener(object): - """Get Ubuntu Quantal identification files.""" @staticmethod @@ -159,7 +155,6 @@ DISTRIB_DESCRIPTION="Ubuntu 12.10" class _EmptyOpener(object): - """Get no identification files.""" @staticmethod @@ -174,7 +169,6 @@ class _EmptyOpener(object): class DistroNameTestCase(unittest.TestCase): - """Tests for obtaining distro name.""" def test_nonempty(self): @@ -643,7 +637,6 @@ _PARSED_LSPCI_OUTPUT = ( class LspciParsingTestCase(unittest.TestCase): - """Tests for getting data about PCI devices.""" def test_parsing(self): @@ -666,9 +659,9 @@ Device Descriptor: idVendor 0x1d6b Linux Foundation idProduct 0x0002 2.0 root hub bcdDevice 3.00 - iManufacturer 3 - iProduct 2 - iSerial 1 + iManufacturer 3 + iProduct 2 + iSerial 1 bNumConfigurations 1 Configuration Descriptor: bLength 9 @@ -676,7 +669,7 @@ Device Descriptor: wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 - iConfiguration 0 + iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup @@ -690,7 +683,7 @@ Device Descriptor: bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub - iInterface 0 + iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 @@ -714,9 +707,9 @@ Device Descriptor: idVendor 0x1d6b Linux Foundation idProduct 0x0002 2.0 root hub bcdDevice 3.00 - iManufacturer 3 - iProduct 2 - iSerial 1 + iManufacturer 3 + iProduct 2 + iSerial 1 bNumConfigurations 1 Configuration Descriptor: bLength 9 @@ -724,7 +717,7 @@ Device Descriptor: wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 - iConfiguration 0 + iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup @@ -738,7 +731,7 @@ Device Descriptor: bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub - iInterface 0 + iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 @@ -762,9 +755,9 @@ Device Descriptor: idVendor 0x1d6b Linux Foundation idProduct 0x0001 1.1 root hub bcdDevice 3.00 - iManufacturer 3 - iProduct 2 - iSerial 1 + iManufacturer 3 + iProduct 2 + iSerial 1 bNumConfigurations 1 Configuration Descriptor: bLength 9 @@ -772,7 +765,7 @@ Device Descriptor: wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 - iConfiguration 0 + iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup @@ -786,7 +779,7 @@ Device Descriptor: bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub - iInterface 0 + iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 @@ -810,9 +803,9 @@ Device Descriptor: idVendor 0x1d6b Linux Foundation idProduct 0x0001 1.1 root hub bcdDevice 3.00 - iManufacturer 3 - iProduct 2 - iSerial 1 + iManufacturer 3 + iProduct 2 + iSerial 1 bNumConfigurations 1 Configuration Descriptor: bLength 9 @@ -820,7 +813,7 @@ Device Descriptor: wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 - iConfiguration 0 + iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup @@ -834,7 +827,7 @@ Device Descriptor: bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub - iInterface 0 + iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 @@ -846,21 +839,21 @@ Device Descriptor: wMaxPacketSize 0x0002 1x 2 bytes bInterval 255 -Bus 004 Device 002: ID 1c4f:0002 SiGma Micro +Bus 004 Device 002: ID 1c4f:0002 SiGma Micro Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) - bDeviceSubClass 0 - bDeviceProtocol 0 + bDeviceSubClass 0 + bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x1c4f SiGma Micro - idProduct 0x0002 + idProduct 0x0002 bcdDevice 1.10 - iManufacturer 1 - iProduct 2 - iSerial 0 + iManufacturer 1 + iProduct 2 + iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 @@ -868,7 +861,7 @@ Device Descriptor: wTotalLength 59 bNumInterfaces 2 bConfigurationValue 1 - iConfiguration 0 + iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup @@ -882,7 +875,7 @@ Device Descriptor: bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 1 Keyboard - iInterface 0 + iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 @@ -891,7 +884,7 @@ Device Descriptor: bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 54 - Report Descriptors: + Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 @@ -912,7 +905,7 @@ Device Descriptor: bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None - iInterface 0 + iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 @@ -921,7 +914,7 @@ Device Descriptor: bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 50 - Report Descriptors: + Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 @@ -934,21 +927,21 @@ Device Descriptor: wMaxPacketSize 0x0003 1x 3 bytes bInterval 10 -Bus 003 Device 002: ID 056a:00d6 Wacom Co., Ltd +Bus 003 Device 002: ID 056a:00d6 Wacom Co., Ltd Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) - bDeviceSubClass 0 - bDeviceProtocol 0 + bDeviceSubClass 0 + bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x056a Wacom Co., Ltd - idProduct 0x00d6 + idProduct 0x00d6 bcdDevice 1.11 - iManufacturer 1 - iProduct 2 - iSerial 0 + iManufacturer 1 + iProduct 2 + iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 @@ -956,7 +949,7 @@ Device Descriptor: wTotalLength 59 bNumInterfaces 2 bConfigurationValue 1 - iConfiguration 0 + iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 98mA @@ -969,7 +962,7 @@ Device Descriptor: bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 2 Mouse - iInterface 0 + iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 @@ -978,7 +971,7 @@ Device Descriptor: bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 176 - Report Descriptors: + Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 @@ -999,7 +992,7 @@ Device Descriptor: bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None - iInterface 0 + iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 @@ -1008,7 +1001,7 @@ Device Descriptor: bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 75 - Report Descriptors: + Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 @@ -1086,7 +1079,6 @@ _PARSED_LSUSB_OUTPUT = ( class LsusbParsingTestCase(unittest.TestCase): - """Tests for getting data about USB devices.""" def test_parsing(self): @@ -1102,15 +1094,15 @@ Device Descriptor: bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) - bDeviceSubClass 0 - bDeviceProtocol 0 + bDeviceSubClass 0 + bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x13b1 Linksys idProduct 0x0020 WUSB54GC v1 802.11g Adapter [Ralink RT73] bcdDevice 0.01 - iManufacturer 1 - iProduct 2 - iSerial 0 + iManufacturer 1 + iProduct 2 + iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 @@ -1118,7 +1110,7 @@ Device Descriptor: wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 - iConfiguration 0 + iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 300mA @@ -1131,7 +1123,7 @@ Device Descriptor: bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol - iInterface 0 + iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 @@ -1161,15 +1153,15 @@ Device Descriptor: bDescriptorType 1 bcdUSB 1.00 bDeviceClass 0 (Defined at Interface level) - bDeviceSubClass 0 - bDeviceProtocol 0 + bDeviceSubClass 0 + bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0483 SGS Thomson Microelectronics idProduct 0x2016 Fingerprint Reader bcdDevice 0.01 - iManufacturer 1 - iProduct 2 - iSerial 0 + iManufacturer 1 + iProduct 2 + iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 @@ -1177,7 +1169,7 @@ Device Descriptor: wTotalLength 39 bNumInterfaces 1 bConfigurationValue 1 - iConfiguration 0 + iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup @@ -1189,9 +1181,9 @@ Device Descriptor: bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class - bInterfaceSubClass 0 - bInterfaceProtocol 0 - iInterface 0 + bInterfaceSubClass 0 + bInterfaceProtocol 0 + iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 @@ -1239,7 +1231,6 @@ _DEVICES_SINGLEDIGIT_SUBCLASS = ({ class CreatingDevicesTestCase(unittest.TestCase): - """Tests for creating devices.""" # TODO change various APIs so it will be easy to check what