About

This module handles commands and parsing input

All commands are #bp.[plugin].[cmd]

Commands

commands

!


usage: #bp.commands.! [-h] [number]

run a command in history

positional arguments:
  number      the history # to run (default: -1)

optional arguments:
  -h, --help  show help (default: False)

history


usage: #bp.commands.history [-c] [-h]

list the command history

optional arguments:
  -c, --clear  clear the history (default: False)
  -h, --help   show help (default: False)

list


usage: #bp.commands.list [-h] [category] [cmd]

list commands in a category

positional arguments:
  category    the category to see help for
  cmd         the command in the category (can be left out)

optional arguments:
  -h, --help  show help (default: False)

Base

api


usage: #bp.commands.api [-h] [api]

list functions in the api

positional arguments:
  api         api to get details of

optional arguments:
  -h, --help  show help (default: False)

help


usage: #bp.commands.help [-a] [-c] [-h]

show help info for this plugin

optional arguments:
  -a, --api       show functions this plugin has in the api (default: False)
  -c, --commands  show commands in this plugin (default: False)
  -h, --help      show help (default: False)

inspect


usage: #bp.commands.inspect [-m METHOD] [-o OBJECT] [-s] [-h]

inspect a plugin

optional arguments:
  -m METHOD, --method METHOD
                        get code for a method
  -o OBJECT, --object OBJECT
                        show an object of the plugin, can be method or
                        variable
  -s, --simple          show a simple output (default: False)
  -h, --help            show help (default: False)

reset


usage: #bp.commands.reset [-h]

reset the plugin

optional arguments:
  -h, --help  show help (default: False)

save


usage: #bp.commands.save [-h]

save the plugin state

optional arguments:
  -h, --help  show help (default: False)

set


usage: #bp.commands.set [-h] [name] [value]

change a setting in the plugin

if there are no arguments or 'list' is the first argument then
it will list the settings for the plugin

positional arguments:
  name        the setting name (default: list)
  value       the new value of the setting

optional arguments:
  -h, --help  show help (default: False)

stats


usage: #bp.commands.stats [-h]

show plugin stats

optional arguments:
  -h, --help  show help (default: False)

Settings

historysize


the size of the history to keep

spamcount


the # of times a command can be run before an antispam command

lastcmd


the last command that was sent to the mud

antispamcommand


the antispam command to send

cmdcount


the # of times the current command has been run

API

run


commands.run(plugin, cmdname, argstring)

    run a command and return the output


original defined in plugins/core/commands.py

default


commands.default(cmd, plugin=None)
  set the default command for a plugin
    sname    = the plugin of the command
    cmdname  = the name of the command

    this function returns True if the command exists, False if it doesn't

original defined in plugins/core/commands.py

list


commands.list(plugin, cformat=True)

    list commands for a plugin


original defined in plugins/core/commands.py

remove


commands.remove(sname, cmdname)
  remove a command
    sname    = the top level of the command
    cmdname  = the name of the command

    this function returns no values

original defined in plugins/core/commands.py

add


commands.add(cmdname, func, **kwargs)
  add a command
    cmdname  = the base that the api should be under
    func   = the function that should be run when this command is executed
    keyword arguments
      shelp    = the short help, a brief description of what the
                                          command does
      lhelp    = a longer description of what the command does
      preamble = show the preamble for this command (default: True)
      format   = format this command (default: True)
      group    = the group this command is in

    The command will be added as sname.cmdname

    sname is gotten from the class the function belongs to or the sname key
      in args

    this function returns no values

original defined in plugins/core/commands.py

cmdhelp


commands.cmdhelp(plugin, cmd)

    get the help for a command


original defined in plugins/core/commands.py

change


commands.change(plugin, command, flag, value)

    change an attribute for a command


original defined in plugins/core/commands.py

removeplugin


commands.removeplugin(plugin)
  remove all commands for a plugin
    sname    = the plugin to remove commands for

    this function returns no values

original defined in plugins/core/commands.py