TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: R.WIESER
date: 2019-12-03 12:26:00
subject: Re: RPi.GPIO-0.7.0 - a fe

Richard,

To clarify:

>>> PWM_init_PWMType sets up the type (someting that doesn't need
>>> to know about any module it may end up in),

That sounds quite logical.

>>> PyModule_AddObject gives the type a name in a module.

That commands last argument reaches into the PWM module, which goes against
what you mentioned above, and which is what I tried to refer to: The main
module should also not need to know anything about the PWM one, but for how
to call its class initialisator - which, I could imagine, might have a
strictly defined name.

But as I have no reason (yet) to go against conventions I've choosen to
slightly alter the main modules PWM modules initializing code:

// Add PWM class
if (( pwmtype = PWM_init_PWMType()) == NULL)
...
Py_INCREF(pwmtype);
PyModule_AddObject(module, "PWM", (PyObject*)pwmtype);

This way the main module also doesn't know anything about the PWM modules
internal data (als have removed the PWMType declaration from the PWM modules
header file)

Any objections or other remarks ?

Regards,
Rudy Wieser

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.