plugin_handler

class core.plugin_handler.subscriptions[source]

Manage plugin subscriptions and events

call_plugin(plugin_function, event)[source]

Call a plugin

Parameters:
  • plugin_function
  • event
Returns:

a response object

process_event(event, db)[source]

Select the right plugin for a command event and run it

Parameters:
  • event
  • db
Return a response object:
 
class core.plugin_handler.PythonLoader(file_path)[source]

The class that loads the plugins

import_name()[source]

Properly format a plugin name for import

Return a file path:
 
is_plugin(fs_tools=<module 'posixpath' from '/home/docs/checkouts/readthedocs.org/user_builds/will/envs/latest/lib/python3.5/posixpath.py'>)[source]

Determine whether a file in the plugin directory is a plugin

Parameters:fs_tools
Return boolean:
load()[source]

Use importlib to import the plugin file

update_path()[source]

Append data to sys.path

class core.plugin_handler.PythonLoader(file_path)[source]

The class that loads the plugins

import_name()[source]

Properly format a plugin name for import

Return a file path:
 
is_plugin(fs_tools=<module 'posixpath' from '/home/docs/checkouts/readthedocs.org/user_builds/will/envs/latest/lib/python3.5/posixpath.py'>)[source]

Determine whether a file in the plugin directory is a plugin

Parameters:fs_tools
Return boolean:
load()[source]

Use importlib to import the plugin file

update_path()[source]

Append data to sys.path

core.plugin_handler.load(dir_path, DB)[source]

Run the plugin loader on processed plugins

Parameters:
  • dir_path
  • DB
core.plugin_handler.process_plugins(path)[source]

Process and import the plugins

Parameters:path
core.plugin_handler.subscribe(subscription_data)[source]

Provides a decorator for subscribing plugin to commands

Parameters:subscription_data – A dict containing the name and check function
class core.plugin_handler.subscriptions[source]

Manage plugin subscriptions and events

call_plugin(plugin_function, event)[source]

Call a plugin

Parameters:
  • plugin_function
  • event
Returns:

a response object

process_event(event, db)[source]

Select the right plugin for a command event and run it

Parameters:
  • event
  • db
Return a response object: