diff options
author | W. Trevor King <wking@drexel.edu> | 2008-11-24 17:02:16 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-11-24 17:02:16 -0500 |
commit | 2c3f6c066ceb03ae3579dff029bf01f0b62c1f82 (patch) | |
tree | 4111ef606fa52dc7f21ca3eb357ff83fae74fe1e /README.dev | |
parent | 442e5b00c8b5bf65041d0a1dafbf8c7eac0d5356 (diff) | |
download | bugseverywhere-2c3f6c066ceb03ae3579dff029bf01f0b62c1f82.tar.gz |
Tweaked usage strings to increase consistency. Also added README.dev.
I tried to stick to CAPS for argument placeholders.
Diffstat (limited to 'README.dev')
-rw-r--r-- | README.dev | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/README.dev b/README.dev new file mode 100644 index 0000000..bb39ba5 --- /dev/null +++ b/README.dev @@ -0,0 +1,28 @@ +Extending BE +============ + +To write a plugin, you simply create a new file in the becommands +directory. Take a look at one of the simpler plugins (e.g. open.py) +for an example of how that looks, and to start getting a feel for the +libbe interface. + +To fit into the current framework, your extension module should +provide the following elements: + __desc__ + A short string describing the purpose of your plugin + execute(args) + The entry function for your plugin. args is everything from + sys.argv after the name of your plugin (e.g. for the command + `be open abc', args=['abc']). + help() + Return the string to be output by `be help <yourplugin>', + `be <yourplugin> --help', etc. + +While that's all that's strictly necessary, many plugins (all the +current ones) use libbe.cmdutil.CmdOptionParser to provide a +consistent interface + get_parser() + Return an instance of CmdOptionParser("<usage string>"). You can + alter the parser (e.g. add some more options) before returning it. + +Again, you can just browse around in becommands to get a feel for things. |