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

Method generate

comtypes/tools/codegenerator/codegenerator.py:85–106  ·  view source on GitHub ↗
(self, item)

Source from the content-addressed store, hash-verified

83 self.last_item = item
84
85 def generate(self, item):
86 if item in self.done:
87 return
88 if self._is_interface_typedesc(item):
89 self._define_interface(item)
90 return
91 if isinstance(item, typedesc.StructureHead):
92 name = getattr(item.struct, "name", None)
93 else:
94 name = getattr(item, "name", None)
95 if name in self.known_symbols:
96 self.imports.add(name, symbols=self.known_symbols)
97 self.done.add(item)
98 if isinstance(item, typedesc.Structure):
99 self.done.add(item.get_head())
100 self.done.add(item.get_body())
101 return
102 mth = getattr(self, type(item).__name__)
103 # to avoid infinite recursion, we have to mark it as done
104 # before actually generating the code.
105 self.done.add(item)
106 mth(item)
107
108 def generate_all(self, items):
109 for item in items:

Callers 15

generate_allMethod · 0.95
ArrayTypeMethod · 0.95
EnumerationMethod · 0.95
TypedefMethod · 0.95
StructureHeadMethod · 0.95
StructureMethod · 0.95
UnionMethod · 0.95
StructureBodyMethod · 0.95
SAFEARRAYTypeMethod · 0.95
PointerTypeMethod · 0.95
CoClassMethod · 0.95
ComInterfaceMethod · 0.95

Calls 5

_define_interfaceMethod · 0.95
addMethod · 0.45
get_headMethod · 0.45
get_bodyMethod · 0.45

Tested by

no test coverage detected