'Make it slightly easier to query against the class,
by calling the namespace\'s query with the class preset.
Won\'t work if the class has been instantiated directly.'

def query(self, fields=[], **where_clause):

    if (self._namespace is None):
        raise x_wmi_no_namespace('You    cannot    query    directly    from    a    WMI    class')
    try:
        field_list = (',    '.join(fields) or '*')
        wql = ((('SELECT    ' + field_list) + '    FROM    ') + self._class_name)
        if where_clause:
            wql += ('    WHERE    ' + '    AND    '.join([('%s    =    %r' % (k, str(v))) for (k, v) in where_clause.items()]))
        return self._namespace.query(wql, self, fields)
    except pywintypes.com_error:
        handle_com_error()
