[ctypes-commit] ctypes/comtypes/tools typedesc.py,1.1.2.10,1.1.2.11 tlbparser.py,1.4.2.22,1.4.2.23 c
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2006-01-02 19:11:59
|
Update of /cvsroot/ctypes/ctypes/comtypes/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4970 Modified Files: Tag: branch_1_0 typedesc.py tlbparser.py codegenerator.py Log Message: Sync with upstream version. Index: tlbparser.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/tools/tlbparser.py,v retrieving revision 1.4.2.22 retrieving revision 1.4.2.23 diff -C2 -d -r1.4.2.22 -r1.4.2.23 *** tlbparser.py 23 Aug 2005 19:42:20 -0000 1.4.2.22 --- tlbparser.py 2 Jan 2006 19:11:49 -0000 1.4.2.23 *************** *** 268,272 **** iid=str(ta.guid), idlflags=self.interface_type_flags(ta.wTypeFlags)) ! itf.doc = str(doc) self._register(itf_name, itf) --- 268,273 ---- iid=str(ta.guid), idlflags=self.interface_type_flags(ta.wTypeFlags)) ! if doc is not None: ! itf.doc = str(doc.split("\0")[0]) self._register(itf_name, itf) *************** *** 424,429 **** # version, control, hidden, and appobject coclass_name, doc = tinfo.GetDocumentation(-1)[0:2] ! ## print tinfo.GetContainingTypeLib()[0].GetLibAttr().guid, coclass_name ! coclass = typedesc.CoClass(coclass_name, str(ta.guid), self.coclass_type_flags(ta.wTypeFlags)) if doc is not None: coclass.doc = doc --- 425,433 ---- # version, control, hidden, and appobject coclass_name, doc = tinfo.GetDocumentation(-1)[0:2] ! tlibattr = tinfo.GetContainingTypeLib()[0].GetLibAttr() ! coclass = typedesc.CoClass(coclass_name, ! str(ta.guid), ! self.coclass_type_flags(ta.wTypeFlags), ! tlibattr) if doc is not None: coclass.doc = doc *************** *** 555,559 **** "Parses a type library from a file" def __init__(self, path): ! self.tlib = typeinfo.LoadTypeLibEx(path, regkind=typeinfo.REGKIND_REGISTER) self.items = {} --- 559,564 ---- "Parses a type library from a file" def __init__(self, path): ! # XXX DOESN'T LOOK CORRECT: We should NOT register the typelib. ! self.tlib = typeinfo.LoadTypeLibEx(path)#, regkind=typeinfo.REGKIND_REGISTER) self.items = {} *************** *** 623,626 **** --- 628,637 ---- return None + def _py2exe_hint(): + # If the tlbparser is frozen, we need to include these + import comtypes.persist + import comtypes.typeinfo + import comtypes.automation + def generate_module(tlib, ofi, make_module, name_module): known_symbols = {} Index: codegenerator.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/tools/codegenerator.py,v retrieving revision 1.6.2.21 retrieving revision 1.6.2.22 diff -C2 -d -r1.6.2.21 -r1.6.2.22 *** codegenerator.py 20 Oct 2005 17:17:48 -0000 1.6.2.21 --- codegenerator.py 2 Jan 2006 19:11:49 -0000 1.6.2.22 *************** *** 72,77 **** if self._COMMETHOD_defined: return ! if __debug__: ! print >> self.imports, "from comtypes import helpstring" super(Generator, self).need_COMMETHOD() --- 72,76 ---- if self._COMMETHOD_defined: return ! print >> self.imports, "from comtypes import helpstring" super(Generator, self).need_COMMETHOD() *************** *** 80,87 **** if self._DISPMETHOD_defined: return ! if __debug__: ! print >> self.imports, "from comtypes import DISPMETHOD, DISPPROPERTY, helpstring" ! else: ! print >> self.imports, "from comtypes import DISPMETHOD, DISPPROPERTY" self._DISPMETHOD_defined = True --- 79,83 ---- if self._DISPMETHOD_defined: return ! print >> self.imports, "from comtypes import DISPMETHOD, DISPPROPERTY, helpstring" self._DISPMETHOD_defined = True *************** *** 158,161 **** --- 154,162 ---- print >> self.stream, " _idlflags_ = %s" % coclass.idlflags ##X print >> self.stream, "POINTER(%s).__ctypes_from_outparam__ = wrap" % coclass.name + + libid = coclass.tlibattr.guid + wMajor, wMinor = coclass.tlibattr.wMajorVerNum, coclass.tlibattr.wMinorVerNum + print >> self.stream, " _reg_typelib_ = (%r, %s, %s)" % (str(libid), wMajor, wMinor) + for itf, idlflags in coclass.interfaces: self.generate(itf.get_head()) *************** *** 169,176 **** --- 170,179 ---- print >> self.stream, "%s._outgoing_interfaces_ = [%s]" % (coclass.name, ", ".join(sources)) print >> self.stream + self.names.add(coclass.name) def ComInterface(self, itf): self.generate(itf.get_head()) self.generate(itf.get_body()) + self.names.add(itf.name) def _is_enuminterface(self, itf): *************** *** 197,200 **** --- 200,204 ---- self.need_GUID() print >> self.stream, "class %s(%s):" % (head.itf.name, basename) + print >> self.stream, " _case_insensitive_ = True" doc = getattr(head.itf, "doc", None) if doc: *************** *** 265,268 **** --- 269,273 ---- self.generate(itf.get_head()) self.generate(itf.get_body()) + self.names.add(itf.name) def DispInterfaceHead(self, head): *************** *** 272,275 **** --- 277,281 ---- self.need_GUID() print >> self.stream, "class %s(%s):" % (head.itf.name, basename) + print >> self.stream, " _case_insensitive_ = True" doc = getattr(head.itf, "doc", None) if doc: Index: typedesc.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/tools/typedesc.py,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** typedesc.py 24 Aug 2005 11:49:29 -0000 1.1.2.10 --- typedesc.py 2 Jan 2006 19:11:49 -0000 1.1.2.11 *************** *** 117,124 **** class CoClass(object): ! def __init__(self, name, clsid, idlflags): self.name = name self.clsid = clsid self.idlflags = idlflags self.interfaces = [] --- 117,125 ---- class CoClass(object): ! def __init__(self, name, clsid, idlflags, tlibattr): self.name = name self.clsid = clsid self.idlflags = idlflags + self.tlibattr = tlibattr self.interfaces = [] |