def EnumObjects(self, hwndOwner, flags): objects = get_clbr_for_file(self.path) pidls = [] for name, ob in objects.items(): pidls.append( ["object\0" + self.path + "\0" + name] ) return NewEnum(pidls, iid=shell.IID_IEnumIDList, useDispatcher=(debug>0))
def EnumObjects(self, hwndOwner, flags): assert self.method_name is None, "Should not be enuming methods!" mod_objects = get_clbr_for_file(self.path) my_objects = mod_objects[self.class_name] pidls = [] for func_name, lineno in my_objects.methods.items(): pidl = ["object\0" + self.path + "\0" + self.class_name + "." + func_name] pidls.append(pidl) return NewEnum(pidls, iid=shell.IID_IEnumIDList, useDispatcher=(debug>0))
def EnumObjects(self, hwndOwner, flags): pidls = [] for fname in os.listdir(self.path): fqn = os.path.join(self.path, fname) if os.path.isdir(fqn): type_name = "directory" type_class = ShellFolderDirectory else: base, ext = os.path.splitext(fname) if ext in [".py", ".pyw"]: type_class = ShellFolderFile type_name = "file" else: type_class = None if type_class is not None: pidls.append( [type_name + "\0" + fqn] ) return NewEnum(pidls, iid=shell.IID_IEnumIDList, useDispatcher=(debug>0))
def EnumFormatEtc(self, direction): if direction != pythoncom.DATADIR_GET: raise COMException(hresult=winerror.E_NOTIMPL) return NewEnum(self.supported_fe, iid=pythoncom.IID_IEnumFORMATETC)
def _query_interface_(self, iid): if iid == pythoncom.IID_IEnumFORMATETC: return NewEnum(self.supported_fe, iid=iid)
def EnumObjects(self, hwndOwner, flags): items = [["directory\0" + p] for p in sys.path if os.path.isdir(p)] return NewEnum(items, iid=shell.IID_IEnumIDList, useDispatcher=(debug > 0))