-
Notifications
You must be signed in to change notification settings - Fork 851
Fix struct handling in makepy generated code #2560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
f59e1ba
35f46ff
ef45c98
5131e7c
e6bbc1c
b41420e
9c1388b
c9a1dce
e6f5857
29c6533
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -382,6 +382,22 @@ def MakeDispatchFuncMethod(self, entry, name, bMakeClass=1): | |
| if doc and doc[1]: | ||
| ret.append(linePrefix + "\t" + _makeDocString(doc[1])) | ||
|
|
||
| for i in range(len(fdesc[2])): | ||
| desc = fdesc[2][i] | ||
|
|
||
| if ( | ||
| desc[1] & (pythoncom.PARAMFLAG_FOUT | pythoncom.PARAMFLAG_FIN) | ||
| == pythoncom.PARAMFLAG_FOUT | ||
| ): | ||
| if ( | ||
| desc[0] & pythoncom.VT_RECORD | ||
| and desc[3] | ||
| and desc[3].__class__.__name__ == "PyIID" | ||
| ): | ||
| newVal = f"pythoncom.GetRecordFromGuids(CLSID, MajorVersion, MinorVersion, LCID, {repr(desc[3])})" | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @geppi, do you have any thoughts on this pr?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the delay, I'm in the mountains over the long Easter weekend and can take a detailed look into this earliest on tuesday. My first thought is that I should probably just write some documentation about the functionality we recently introduced for COM Records with PR #2437.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like in-code comments parsed by a tool called AutoDuck is used to generate helpfiles. Those helpfiles are then decompiled to extract the HTML and are hosted as a GitHub page: In #2432 I'm trying to restore shipping the helpfiles (by adding them to the build commands without building pywin32 twice) to users for local no-internet documentation.
the-snork marked this conversation as resolved.
Outdated
|
||
| ret.append(linePrefix + "\t" + f"if {names[i+1]} == {defOutArg}:") | ||
| ret.append(linePrefix + "\t\t" + f"{names[i+1]} = {newVal}") | ||
|
the-snork marked this conversation as resolved.
Outdated
|
||
|
|
||
| resclsid = entry.GetResultCLSID() | ||
| if resclsid: | ||
| resclsid = "'%s'" % resclsid | ||
|
|
@@ -592,7 +608,7 @@ def _ResolveType(typerepr, itypeinfo): | |
| return pythoncom.VT_UNKNOWN, clsid, retdoc | ||
|
|
||
| elif typeKind == pythoncom.TKIND_RECORD: | ||
| return pythoncom.VT_RECORD, None, None | ||
| return pythoncom.VT_RECORD, resultAttr.iid, None | ||
| raise NotSupportedException("Can not resolve alias or user-defined type") | ||
| return typeSubstMap.get(typerepr, typerepr), None, None | ||
|
|
||
|
|
@@ -612,6 +628,7 @@ def _BuildArgList(fdesc, names): | |
| name_num = 0 | ||
| while len(names) < numArgs: | ||
| names.append("arg%d" % (len(names),)) | ||
|
|
||
| # As per BuildCallList(), avoid huge lines. | ||
| # Hack a "\n" at the end of every 5th name | ||
| for i in range(0, len(names), 5): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.