(self, raw_results, includes_qualifiers)
return results
Parse WMI query results in a more comprehensive form.

        Returns: List of WMI objects
        ```
        [
            {
                'freemegabytes': 19742.0,
                'name': 'C:',
                'avgdiskbytesperwrite': 1536.0
            }, {
                'freemegabytes': 19742.0,
                'name': 'D:',
                'avgdiskbytesperwrite': 1536.0
            }
        ]
        ```
Parse WMI query results in a more comprehensive form.
Parse WMI query results in a more comprehensive form .
def _parse_results(self, raw_results, includes_qualifiers):
        """
        Parse WMI query results in a more comprehensive form.

        Returns: List of WMI objects
        ```
        [
            {
                'freemegabytes': 19742.0,
                'name': 'C:',
                'avgdiskbytesperwrite': 1536.0
            }, {
                'freemegabytes': 19742.0,
                'name': 'D:',
                'avgdiskbytesperwrite': 1536.0
            }
        ]
        ```
        """
        results = []
        for res in raw_results:
            # Ensure all properties are available. Use case-insensitivity
            # because some properties are returned with different cases.
            item = CaseInsensitiveDict()
            for prop_name in self.property_names:
                item[prop_name] = None

            for wmi_property in res.Properties_:
                # IMPORTANT: To improve performance, only access the Qualifiers
                # if the "CounterType" hasn't already been cached.
                should_get_qualifier_type = (
                    includes_qualifiers and wmi_property.Name not in self._property_counter_types
                )

                if should_get_qualifier_type:

                    # Can't index into "Qualifiers_" for keys that don't exist
                    # without getting an exception.
                    qualifiers = dict((q.Name, q.Value) for q in wmi_property.Qualifiers_)

                    # Some properties like "Name" and "Timestamp_Sys100NS" do
                    # not have a "CounterType" (since they're not a counter).
                    # Therefore, they're ignored.
                    if "CounterType" in qualifiers:
                        counter_type = qualifiers["CounterType"]
                        self._property_counter_types[wmi_property.Name] = counter_type

                        self.logger.debug(
                            u"Caching property qualifier CounterType: %s.%s = %s",
                            self.class_name,
                            wmi_property.Name,
                            counter_type,
                        )
                    else:
                        self.logger.debug(
                            u"CounterType qualifier not found for %s.%s", self.class_name, wmi_property.Name
                        )

                try:
                    item[wmi_property.Name] = float(wmi_property.Value)
                except (TypeError, ValueError):
                    item[wmi_property.Name] = wmi_property.Value

            results.append(item)
        return results
def _parse_results ( self , raw_results , includes_qualifiers ) : results = [ ] for res in raw_results : # Ensure all properties are available. Use case-insensitivity # because some properties are returned with different cases. item = CaseInsensitiveDict ( ) for prop_name in self . property_names : item [ prop_name ] = None for wmi_property in res . Properties_ : # IMPORTANT: To improve performance, only access the Qualifiers # if the "CounterType" hasn't already been cached. should_get_qualifier_type = ( includes_qualifiers and wmi_property . Name not in self . _property_counter_types ) if should_get_qualifier_type : # Can't index into "Qualifiers_" for keys that don't exist # without getting an exception. qualifiers = dict ( ( q . Name , q . Value ) for q in wmi_property . Qualifiers_ ) # Some properties like "Name" and "Timestamp_Sys100NS" do # not have a "CounterType" (since they're not a counter). # Therefore, they're ignored. if "CounterType" in qualifiers : counter_type = qualifiers [ "CounterType" ] self . _property_counter_types [ wmi_property . Name ] = counter_type self . logger . debug ( u"Caching property qualifier CounterType: %s.%s = %s" , self . class_name , wmi_property . Name , counter_type , ) else : self . logger . debug ( u"CounterType qualifier not found for %s.%s" , self . class_name , wmi_property . Name ) try : item [ wmi_property . Name ] = float ( wmi_property . Value ) except ( TypeError , ValueError ) : item [ wmi_property . Name ] = wmi_property . Value results . append ( item ) return results