Specifies a COM method slot with idlflags. XXX should explain the sematics of the arguments.
(idlflags, restype, methodname, *argspec)
| 190 | |
| 191 | |
| 192 | def COMMETHOD(idlflags, restype, methodname, *argspec) -> _ComMemberSpec: |
| 193 | """Specifies a COM method slot with idlflags. |
| 194 | |
| 195 | XXX should explain the sematics of the arguments. |
| 196 | """ |
| 197 | # collect all helpstring instances |
| 198 | # We should suppress docstrings when Python is started with -OO |
| 199 | # join them together(does this make sense?) and replace by None if empty. |
| 200 | helptext = "".join(t for t in idlflags if isinstance(t, helpstring)) or None |
| 201 | paramflags, argtypes = _resolve_argspec(argspec) |
| 202 | if "propget" in idlflags: |
| 203 | name = f"_get_{methodname}" |
| 204 | elif "propput" in idlflags: |
| 205 | name = f"_set_{methodname}" |
| 206 | elif "propputref" in idlflags: |
| 207 | name = f"_setref_{methodname}" |
| 208 | else: |
| 209 | name = methodname |
| 210 | return _ComMemberSpec( |
| 211 | restype, name, argtypes, paramflags, tuple(idlflags), helptext |
| 212 | ) |
| 213 | |
| 214 | |
| 215 | ################################################################ |
no test coverage detected
searching dependent graphs…