About

This plugin handles events. You can register/unregister with events, raise events

Using

Registering an event from a plugin

  • self.api('events.register')(eventname, function)

Unregistering an event

  • self.api('events.unregister')(eventname, function)

Raising an event

  • self.api('events.eraise')(eventname, argtable)

Commands

events

detail


usage: #bp.events.detail [-h] [event [event ...]]

get details of an event

positional arguments:
  event       the event name to get details for (default: [])

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

list


usage: #bp.events.list [-h] [match]

list events and the plugins registered with them

positional arguments:
  match       list only events that have this argument in their name

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

Base

api


usage: #bp.events.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.events.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.events.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.events.reset [-h]

reset the plugin

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

save


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

save the plugin state

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

set


usage: #bp.events.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.events.stats [-h]

show plugin stats

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

API

unregister


events.unregister(eventname, func, **kwargs)
  unregister a function with an event
    eventname   = The event to unregister with
    func        = The function to unregister
    keyword arguments:
      plugin        = the plugin this function is a part of

    this function returns no values

original defined in plugins/core/events.py

register


events.register(eventname, func, **kwargs)
  register a function with an event
    eventname   = The event to register with
    func        = The function to register
    keyword arguments:
      prio          = the priority of the function (default: 50)

    this function returns no values

original defined in plugins/core/events.py

gete


events.gete(eventname)
  return an event
    eventname   = the event to return

    this function returns a dictionary of format
      pluginslist = list of plugins that use this event
      funclist = a dictionary of funcnames, with their plugin,
              function name, and prio as values in a dictionary
      numraised = the number of times this event was raised


original defined in plugins/core/events.py

detail


events.detail(eventname)
  get the details of an event
    eventname = The event name

    this function returns a list of strings for the info

original defined in plugins/core/events.py

eraise


events.eraise(eventname, args=None)
  raise an event with args
    eventname   = The event to raise
    args        = A table of arguments

    this function returns no values

original defined in plugins/core/events.py

removeplugin


events.removeplugin(plugin)
  remove all registered functions that are specific to a plugin
    plugin   = The plugin to remove events for
    this function returns no values

original defined in plugins/core/events.py