Esempio n. 1
0
def com_iter(obj: DispatchBaseClass, lcid=0):
    """
    Iterate over the items that the given COM object contains.  Yields the proper classes rather than the base classes.
    """
    invkind = DISPATCH_METHOD | DISPATCH_PROPERTYGET
    try:
        enum = obj._oleobj_.InvokeTypes(DISPID_NEWENUM, lcid, invkind,
                                        (13, 10), ())
    except com_error:  # It is not possible to iterate over the given object
        raise IterationNotSupported
    else:
        for value in enum.QueryInterface(IID_IEnumVARIANT):
            yield _get_good_object_(
                value
            )  # When no clsid is provided, it returns the correct subclass
Esempio n. 2
0
 def _make_retval_(self, result):
     return _get_good_object_(result, resultCLSID=self.resultCLSID)
Esempio n. 3
0
 def __next__(self):
     return _get_good_object_(next(self._iter_),
                              resultCLSID=self.resultCLSID)
Esempio n. 4
0
 def next(self):
     return _get_good_object_(self._iter_.next(), resultCLSID=self.resultCLSID)
Esempio n. 5
0
 def _make_retval_(self, result):
     return _get_good_object_(result, resultCLSID=self.resultCLSID)
Esempio n. 6
0
File: util.py Progetto: hkfr/data
	def next(self):
		return _get_good_object_(self._iter_.next())
Esempio n. 7
0
 def next(self):
     return _get_good_object_(self._iter_.next(),
                              resultCLSID=self.resultCLSID)
Esempio n. 8
0
	def __next__(self):
		return _get_good_object_(next(self._iter_), resultCLSID = self.resultCLSID)