MCPcopy Create free account
hub / github.com/enthought/comtypes / from_progid

Method from_progid

comtypes/GUID.py:54–67  ·  view source on GitHub ↗

Get guid from progid, ...

(cls, progid: Any)

Source from the content-addressed store, hash-verified

52
53 @classmethod
54 def from_progid(cls, progid: Any) -> "hints.Self":
55 """Get guid from progid, ..."""
56 if hasattr(progid, "_reg_clsid_"):
57 progid = progid._reg_clsid_
58 if isinstance(progid, cls):
59 return progid
60 elif isinstance(progid, str):
61 if progid.startswith("{"):
62 return cls(progid)
63 inst = cls()
64 _CLSIDFromProgID(str(progid), byref(inst))
65 return inst
66 else:
67 raise TypeError(f"Cannot construct guid from {progid!r}")
68
69 def as_progid(self) -> str:
70 """Convert a GUID into a progid"""

Callers 9

GetActiveObjectFunction · 0.80
RegisterActiveObjectFunction · 0.80
GetClassObjectFunction · 0.80
CreateObjectFunction · 0.80
test_agilent.pyFile · 0.80
test_git.pyFile · 0.80
test_clsidMethod · 0.80
test_msscript.pyFile · 0.80
test_from_progidMethod · 0.80

Calls

no outgoing calls

Tested by 2

test_clsidMethod · 0.64
test_from_progidMethod · 0.64