':param ole_object: The WMI class/instance whose method is to be called
:param method_name: The name of the method to be called'

def __init__(self, ole_object, method_name):

    try:
        self.ole_object = Dispatch(ole_object)
        self.method = ole_object.Methods_(method_name)
        self.qualifiers = {}
        for q in self.method.Qualifiers_:
            self.qualifiers[q.Name] = q.Value
        self.provenance = '\n'.join(self.qualifiers.get('MappingStrings', []))
        self.in_parameters = self.method.InParameters
        self.out_parameters = self.method.OutParameters
        if (self.in_parameters is None):
            self.in_parameter_names = []
        else:
            self.in_parameter_names = [(i.Name, i.IsArray) for i in self.in_parameters.Properties_]
        if (self.out_parameters is None):
            self.out_parameter_names = []
        else:
            self.out_parameter_names = [(i.Name, i.IsArray) for i in self.out_parameters.Properties_]
        doc = ('%s    (%s)    =>    (%s)' % (method_name, ',    '.join([(name + ('', '[]')[is_array]) for (name, is_array) in self.in_parameter_names]), ',    '.join([(name + ('', '[]')[is_array]) for (name, is_array) in self.out_parameter_names])))
        privileges = self.qualifiers.get('Privileges', [])
        if privileges:
            doc += ('    |    Needs:    ' + ',    '.join(privileges))
        self.__doc__ = doc
    except pywintypes.com_error:
        handle_com_error()
