How can I get the module object/namespace for an already-loaded script datablock, given only the name/ID/path of the text datablock?
.as_module() doesn't do this, because
D.texts.as_module() is D.texts.as_module() == False—
as_module() returns a new object and namespace, so it can't be used to alter or unregister the already-imported definitions. It also doesn't set
Basically, I'm looking for something like
addon_utils.modules(), except with no fake modules, and if it also included all user scripts from which a type has been registered.