version: python bbsengine5
modules ===
modules are small python scripts that are loaded at run-time.
in order to work, a module must define 'init', 'access', and 'main' and the optional 'buildargs'
-
buildargs(args, **kw)
-
access(args, op="run", **kw):
-
required
-
'args' is an argparse instance
-
op is currently only 'run' and is reserved for future use
-
when access() returns True, access is granted. any other return value will give a 'permission denied' message.
-
-
main(args, **kw):
-
'args' as always
-
**kw is the keyword arguments. this is used, for example, in games like empyre where the current object needs to be passed to a module
-
-
after init() is called and access() passes, main() is called.
-
bbsengine.runmodule(args, module, **kw)
-
kw arg of 'buildargs' set to True will attempt to call <module>.buildargs()
-
return value is same as return value of <module>.main()
-
-
bbsengine.runsubmodule(args, module, **kw)
-
the only diff w submodule is that buildargs() does not get called
-