~launchpad-results/launchpad-results/trunk

« back to all changes in this revision

Viewing changes to lib/lpresults/xunit/parsers/udevadm.py

  • Committer: Marc Tardif
  • Date: 2011-09-14 01:25:40 UTC
  • Revision ID: marc.tardif@canonical.com-20110914012540-1gs255vhv6kb0mg4
Added updating of submissions periodically.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
            class_id = (pci_class >> 8) & 0xFF
47
47
 
48
48
            if class_id == Pci.BASE_CLASS_NETWORK:
49
 
                return "NETWORK"
 
49
                if subclass_id == Pci.CLASS_NETWORK_WIRELESS:
 
50
                    return "WIRELESS"
 
51
                else:
 
52
                    return "NETWORK"
50
53
 
51
54
            if class_id == Pci.BASE_CLASS_DISPLAY:
52
55
                return "VIDEO"
94
97
                return "SOCKET"
95
98
 
96
99
        if "TYPE" in self._environment and "INTERFACE" in self._environment:
97
 
            interface = self._environment["INTERFACE"].split("/")
98
 
            interface_class = int(interface[0])
99
 
            interface_subclass = int(interface[1])
 
100
            interface_class, interface_subclass, interface_protocol = (
 
101
                int(i) for i in self._environment["INTERFACE"].split("/"))
100
102
 
101
103
            if interface_class == Usb.BASE_CLASS_AUDIO:
102
104
                return "AUDIO"
115
117
                return "CAPTURE"
116
118
 
117
119
            if interface_class == Usb.BASE_CLASS_WIRELESS:
118
 
                return "NETWORK"
 
120
                if interface_protocol == Usb.PROTOCOL_BLUETOOTH:
 
121
                    return "BLUETOOTH"
 
122
                else:
 
123
                    return "WIRELESS"
119
124
 
120
125
        if "ID_TYPE" in self._environment:
121
126
            id_type = self._environment["ID_TYPE"]
294
299
        return {}
295
300
 
296
301
    def run(self, result):
297
 
        line_pattern = re.compile(r"(?P<key>\w):\s*(?P<value>.*)")
 
302
        # Some attribute lines have a space character after the
 
303
        # ':', others don't have it (see udevadm-info.c).
 
304
        line_pattern = re.compile(r"(?P<key>[A-Z]):\s*(?P<value>.*)")
298
305
        multi_pattern = re.compile(r"(?P<key>[^=]+)=(?P<value>.*)")
299
306
 
300
307
        output = self.stream.read()