mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Added docstrings and removed an unused import.
This commit is contained in:
parent
69493ebf88
commit
53c6542aa0
@ -36,7 +36,6 @@ their caller to have the 'owner' capability. This plugin is loaded by default.
|
|||||||
|
|
||||||
from fix import *
|
from fix import *
|
||||||
|
|
||||||
import os
|
|
||||||
import gc
|
import gc
|
||||||
import imp
|
import imp
|
||||||
import sys
|
import sys
|
||||||
@ -54,12 +53,14 @@ import privmsgs
|
|||||||
import callbacks
|
import callbacks
|
||||||
|
|
||||||
def loadPluginModule(name):
|
def loadPluginModule(name):
|
||||||
|
"""Loads (and returns) the module for the plugin with the given name."""
|
||||||
moduleInfo = imp.find_module(name, conf.pluginDirs)
|
moduleInfo = imp.find_module(name, conf.pluginDirs)
|
||||||
module = imp.load_module(name, *moduleInfo)
|
module = imp.load_module(name, *moduleInfo)
|
||||||
linecache.checkcache()
|
linecache.checkcache()
|
||||||
return module
|
return module
|
||||||
|
|
||||||
def loadPluginClass(irc, module):
|
def loadPluginClass(irc, module):
|
||||||
|
"""Loads the plugin Class from the given module into the given irc."""
|
||||||
callback = module.Class()
|
callback = module.Class()
|
||||||
irc.addCallback(callback)
|
irc.addCallback(callback)
|
||||||
if hasattr(callback, 'configure'):
|
if hasattr(callback, 'configure'):
|
||||||
|
Loading…
Reference in New Issue
Block a user