enabling or disabling micropython modules at runtime
Posted: Tue Jan 30, 2018 10:55 am
Hi,
I was wondering if it there was a way to register new custom modules in micropython during runtime?
I've currently implemented this by registering them in the MICROPY_PORT_BUILTIN_MODULES list,
and capturing the "import" command it via mp_module_get so the module can't be found/imported unless some other criteria are met,
however this does not exclude the module from being listed in help("modules"), and just feels "wrong".
Is there another, better way to block access to / disable / hide a specific module at runtime?
once loaded, the module can of course remain loaded until the kernel is rebooted...
I was wondering if it there was a way to register new custom modules in micropython during runtime?
I've currently implemented this by registering them in the MICROPY_PORT_BUILTIN_MODULES list,
and capturing the "import" command it via mp_module_get so the module can't be found/imported unless some other criteria are met,
however this does not exclude the module from being listed in help("modules"), and just feels "wrong".
Is there another, better way to block access to / disable / hide a specific module at runtime?
once loaded, the module can of course remain loaded until the kernel is rebooted...