libbe.util.plugin

Allow simple listing and loading of the various becommands and libbe submodules (i.e. “plugins”).

libbe.util.plugin.import_by_name(modname)
>>> mod = import_by_name('libbe.bugdir')
>>> 'BugDir' in dir(mod)
True
>>> import_by_name('libbe.highly_unlikely')
Traceback (most recent call last):
  ...
ImportError: No module named highly_unlikely
libbe.util.plugin.modnames(prefix)
>>> 'list' in [n for n in modnames('libbe.command')]
True
>>> 'plugin' in [n for n in modnames('libbe.util')]
True

Next topic

libbe.util.subproc

This Page